packratting : Java Glossary


Sometimes called loitering or object leaks. Holding references to Objects long after the practical life of the Object has passed. This is a form of memory leak, though calling it a true memory leak would be like blaming the garbage man because your Mom wrote "DO NOT DISCARD" on all the bundles of junk in her attic. In Java, true memory leaks are theoretically impossible (unless you use JNI (Java Native Interface) or your JVM (Java Virtual Machine) is buggy), though packratting is common. In fact it is almost impossible to write a program that nullifies references to every object the instant it will never be needed again. So every program is guilty of minor packratting.

Java talks to the underlying GUI (Graphic User Interface) which is typically written in C++ which does not have automatic garbage collection. Therefore you see kludges in Java dispose methods, to help it along. If you fail to use dispose properly, Java won’t run out of RAM (Random Access Memory), but the GUI will. Failing to use dispose create true memory leaks. Here are some common packratting situations:

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number