views:

53

answers:

1

Hi All

In Eclipse (I am using 3.4 Ganymede) there is an option under

Preferences>General>Show Heap Status

which when checked shows near bottom of IDE like 46M of 98M and if we move the mouse over 'Recycle Bin' it says 'Run Garbage Collector'.

I am curoius to know how this works.What will happen when 'Run Garbage Collector' is clicked.

My enivroment set up is something like jdk6 is insatlled and IDE used for development and run in Tomcat server. So my understanding is all the objects which are run through Tomcat should be garbage collected. Is this correct.

Is there a way to see what objects Eclipse identified as Garbage Cheers

+2  A: 

As mention my previous answer, this is just a call to the JVM System.gc() function. (The JVM in which Eclipse runs: if your Tomcat spaw a new JVM session to execute itself, it wouldn't be impacted by this gc)

But with a plugin like Eclipse MAT, you can also check for unreachable objects, e.g. objects which should be garbage collected but stay around for various reasons, which can be more interesting.

alt text

VonC
Excellent Thanks for the info n plugin
GustlyWind
+1 for nice answer. I tend to click the bin icon at regular intervals when Eclipse is running slow and it does tend to improve performance in my experience
djhworld
@djhworld: a good `eclipse.ini` can help make Eclipse run faster ;) See http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse/1409590#1409590
VonC