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

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: 6063
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


YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.