aspose file tools*
The moose likes Java in General and the fly likes Garbage collector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Garbage collector " Watch "Garbage collector " New topic
Author

Garbage collector

nishant kumarmca
Greenhorn

Joined: Apr 03, 2010
Posts: 16
explain me that is gc a method and what is written inside it?
Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 492

You can view the source code for Java, in your C:\Program Files\Java\jdk1.6.0_21 folder.

Here is the code from the System.gc() method:


And here is the code from the Runtime.gc() method:


I cant seem to find the implementation of gc() at the moment, but that is what is in the System.gc() method.

Hunter



"If the facts don't fit the theory, get new facts" --Albert Einstein
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
You would need to find the code of the JVM. It is supposed to be open-source, but I don't know where to find it.
akash shrimali
Ranch Hand

Joined: Jul 28, 2010
Posts: 45
gc is a method in java coding , invoke the method as specified above and be much more clear with your question , gc is already maintain the heap(memory) for performing the specified tasks , if you get your problem solved then do click the button problem solved!!!1111
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

read garbage collection in java if you want to know about gc....
Remember one thing we cannot force Grabage collection.....its totally dependent on JVM.

You can search on google saying
Garbage collection in java.


SCJP6.0,My blog Ranchers from Delhi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage collector