Forums Register Login

Is this right?

+Pie Number of slices to send: Send
The garbage collector informs your object when it is about to be garbage collected
right or wrong?
+Pie Number of slices to send: Send
right, by invoking ONCE the finalize method of your object.
From the Object API:


protected void finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

 
+Pie Number of slices to send: Send
Thank you! You are a really cool man! I will take the exam 16 Aug.
+Pie Number of slices to send: Send
good luck for the exam!
+Pie Number of slices to send: Send
Good luck Yun
+Pie Number of slices to send: Send
Hi Val:
Quote from your note above:

right, by invoking ONCE the finalize method of your object.
From the Object API:


I think in first GC run, finalize will be
invoked and second GC run the object will be
cleared. Right?
Thanks
Barkat
+Pie Number of slices to send: Send
According to the mark & sweep algorithm the first time it marks objects and then the second time it sweeps .. so any unmarked objects would be collected the second time ..pls correct me if i am mistaken
+Pie Number of slices to send: Send
Neither the JLS nor the JVMS require the use of the mark & sweep algorithm for garbage collection. In fact, the choice of the algorithm is completely up to the JVM vendor. Thus, such assumptions cannot be made.
+Pie Number of slices to send: Send
If your finalize() method "resurrects" the object by making it reachable again, then the next time it becomes unreachable, the garbage collector will not call finalize() a second time.
Those are the largest trousers in the world! Especially when next to this 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 798 times.
Similar Threads
gc
GC
Question on GC
One MORE on GC
another GC (levteck.com)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:10:14.