Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Yourkit profiler - option to force GC

 
Suma Rangaraj
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello all-

I am confused with the option that is given in Yourkit profiler. They have an option to explicitly force GC before taking a snapshot of memory.
Haven't we told time again that a GC cannot be forced? So what does this option mean?

Thanks!
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not guaranteed to work but does (Sun VM) unless you explicitly disable it with a command line option (DisableExplicitGC). (You need to check your VM's documentation or just do it and observe the results ;-) )

Attach visual WM and force a GC and you can see the results, we do it all the time for debugging purposes.

Obviously writing a program relying on this behaviour is different, there's no guarantee it'll do anything.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic