In C++, I thought of setting all variables used to NULL, or 0. In Java, some say to "null" the Objects, or call super.release(), which isn't going anywhere.
What codes do you put inside these "release()" methods?
Jump to content
Posted 19 October 2013 - 12:33 PM
Posted 20 October 2013 - 12:33 AM
That looks like it's specific for "IBM Lotus Form Server API" whatever that is (isn't Lotus IBM's Java Virtual Machine?)
In Hotspot JVM, you don't need to do that. Setting references to null might be aswell a performance hog since you'll have tons of little writes going around. Hotspot finds objects traversing from whatever main function you have and then down from there. Dead objects are never touched in this process.
Hell, I think I even saw this "setting all object pointers to null each time you release it" thing mentioned as one of the top things that might be fine to do in C++ but it shouldn't be done in Java.
EDIT: Found where I heard of it http://www.infoq.com/presentations/JVM-Mechanics
Edited by TheChubu, 20 October 2013 - 12:35 AM.
My journal: Making a Terrain Generator