Could someone explain why there is no destructor in Java classes?
The explanation I remember is destructors are generally used to free
memory, and Java has garbage collection. Doesn't make it right, but that
is the way it is.
Re: Heap and Memory Footprint ... If you have any mixed language objects (i.e. Java objects which have underlying native memory associated), when the object is created memory is allocated in both the Java heap and the C native heap. ... It is important to explicitly call close- otherwise if the object gets promoted to the old area, the memory will not be freed until the object gets garbage collected from the old area which can take a very, very long time (and in the worst case you may have the process hit a memory limit without a garbage collection occurring as only the Java heap's behaviour will trigger garbage collection). ... (comp.lang.java.machine)
Re: MFC future? ... major desktop applications written in C#. I've only seen a couple in Java.... > it's the memory management model used in environments like .NET and Java. ... > everything is managed by garbage collection the garbage collector ends up ... (microsoft.public.vc.mfc)
On Java being slow (was Re: C++, C# or Java.) ... > Very common mantra from nearly every java pundit except me. ...Poor programmers is a somewhat standard excuse, ...Garbage collection, of course, can theoretically be made faster than ...explicit memory management when given enough memory, ... (comp.lang.java.programmer)
Re: MFC future? ... It seems to me that MS must have had some considerable investment in Java at ... it's the memory management model used in environments like .NET and Java. ... everything is managed by garbage collection the garbage collector ends up ... (microsoft.public.vc.mfc)
Re: Another garbage collection question ... You indeed can start the garbage collection whenever you want, it's just an API call on Runtime or such. ... "Calling this method suggests that the Java virtual machine ..." ... If memory isn't tight, either the VM will ignore your request, making it superfluous, or will honor it with a full GC, not a young-generation collection, thus causing the very overhead you seek to avoid. ... (comp.lang.java.programmer)