Linked by Thom Holwerda on Sat 8th Oct 2005 18:40 UTC, submitted by anonymous
Java Programmers agonize over whether to allocate on the stack or on the heap. Some people think garbage collection will never be as efficient as direct memory management, and others feel it is easier to clean up a mess in one big batch than to pick up individual pieces of dust throughout the day. This article pokes some holes in the oft-repeated performance myth of slow allocation in JVMs.
Thread beginning with comment 42018
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Question on Java memory usage
by Simba on Sat 8th Oct 2005 22:44 UTC in reply to "Question on Java memory usage"
Member since:

"The speed of the allocation / deallocation of memory is fine, the question is why is the average java app consume a lot more memory then a native app?"

Because of the virtual machine that makes sure the code you are running is safe, etc.

But also, this is not always true. For example, Firefox routinely uses 50 to 70 Mb of RAM on my system. Most of my Java applications use less.

Reply Parent Score: 1

BryanFeeney Member since:

Firefox uses that much memory because it has to store uncompressed image data (for immediate display) and maintain an in-memory cache (which will grow as you browse more).

It's mainly the JVM. Fortunately Sun (with a little prodding from Apple) has been improving this situation since Java5 by sharing pieces of memory between instances.

Reply Parent Score: 1