To clarify, Java doesn't even load in the entire library at startup: it simply gives the library a virtual address (via mmap()) so that it can be automatically loaded by the OS when it is actually needed. This resuls in less actual memory usage because different processes can share the memory pages, but it makes each process in top appear much larger.
To clarify, Java doesn't even load in the entire library at startup: it simply gives the library a virtual address (via mmap()) so that it can be automatically loaded by the OS when it is actually needed. This resuls in less actual memory usage because different processes can share the memory pages, but it makes each process in top appear much larger.
However, to combat the illusion that Java uses a ton of memory, they're changing it in 1.6. Full details here: http://weblogs.java.net/blog/xiaobinlu/archive/200 5/08/perception_real.html