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.

Forcing Garbage Collection automatically

Moderators: Vladimir Kondratyev, Anton Katilin

Forcing Garbage Collection automatically

Postby edrishn » Wed Oct 01, 2014 4:43 am

Hi and thanks for YourKit,

I'm using Profiler API (CaptureSnapshot) in some automated UI tests for finding memory leaks. It seems garbage collection was not forced in API. When I tested same scenario through Profiler UI and 'Force Garbage Collection' everything is OK.

I had no luck in calling GC.Collect and GC.WaitForPendingFinalizers and ...

Thanks in advance
Posts: 4
Joined: Thu Feb 07, 2013 6:42 am

Re: Forcing Garbage Collection automatically

Postby Anton Katilin » Wed Oct 01, 2014 8:14 am

Hi edrishn

We've added a new method Controller.ForceGC() for this purpose in the latest build 14518:



It does the same as the profiler UI action.

Best regards,
Anton Katilin
Posts: 5788
Joined: Wed Aug 11, 2004 8:37 am

Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 1 guest