Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Is there a means of forcing GC baked in?

Moderators: Vladimir Kondratyev, Anton Katilin

Is there a means of forcing GC baked in?

Postby Michael.Scaman » Mon Mar 23, 2015 2:25 pm

Is it part of either the CLI or the Controller api?

Is there a recommended way? Or do users roll their own using jcmd, a utility jar, or System.gc?
It would be nice if there was a simple way baked into the product
Posts: 34
Joined: Mon Feb 02, 2015 3:14 pm

Re: Is there a means of forcing GC baked in?

Postby Anton Katilin » Tue Mar 24, 2015 8:02 am

The recommended way to deal with GC is to let the JVM decide when and whether to run it. Modern JVMs do not need user's assistance in this regard.

Anyway, you may force GC if you want to. Use any tool you like, the result will be the same:

- the profiler UI has a dedicated toolbar button;
- the profiler API class Controller has method forceGC() (but the command line tool does not have a command for this);
- you can use standard tools like jconsole, etc.
Anton Katilin
Posts: 5741
Joined: Wed Aug 11, 2004 8:37 am

Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 14 guests