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

http://www.yourkit.com/dotnet/download/

http://www.yourkit.com/docs/dotnet/api/Index.html

It does the same as the profiler UI action.

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


Return to .NET Profiler

Who is online

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

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.