Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage collector

 
nishant kumarmca
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
explain me that is gc a method and what is written inside it?
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
Campbell Ritchie
Sheriff
Posts: 48441
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic