
On 19/10/11 10:39, James Harper wrote:
On 18/10/11 10:43, Jason White wrote:
Toby Corkindale<toby.corkindale@strategicdata.com.au> wrote:
However, the default java implementation on 64bit machines assumes that it can grab a gigabyte or so up front, and generally does so!
:/
I hope it wouldn't allocate a gigabyte just to run "hello world".
On my machine (w/6GB of RAM and a couple of GB of swap) java just allocated 1855M (virtual) of RAM to say "hello world" and sleep for 10 seconds.
Can you post the output you parsed to come up with those figures?
It's easy to look at a 'virtual memory usage' figure and jump to conclusions about memory usage but it's much more complicated than that.
I was just looking at the output from 'top' - VIRT, RSS and SHR. I know it's more complicated than just that, but it's a good way to get a quick reading and I wasn't looking to spend more than a minute or so on this :) (I posted all three figures in my original post to the list.) It's worth noting that even though the figure is listed as "virtual", that if you try running a couple of instances up on a virtual machine with limited memory, then the virtual machine runs out of memory and things fail to work. (Tested on OpenVZ) So.. if you can't run more than two or three "hello world" programs at once on a machine with a couple of gig of ram.. it does appear like java really is allocating all that memory. Toby