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 Collection

 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between runtime.gc() and system.gc()
When can we use them and how?
 
anand raman
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the difference lies just in the class they exist. Both indicate to the garbage collector that it is probably a good time to run.
Hope this helps
Anand
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a discussion about that here:
http://www.javaranch.com/ubb/Forum24/HTML/013436.html
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
gabi lupu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sonir shah:
What is the difference between runtime.gc() and system.gc()
When can we use them and how?

system is platform independent and runtime is platform dependent.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic