Forums Register Login

Garbage Collection

+Pie Number of slices to send: Send
What is the difference between runtime.gc() and system.gc()
When can we use them and how?
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 

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.
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 728 times.
Similar Threads
System.gc() and Runtime.gc()
Runtime.gc() and System.gc()
System.gc() vs Runtime.gc()
Reclaiming memory in java without using garbage collector........
from Marcus Green mock
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:57:16.