[conspire] Java in a nutshell

Rick Moen rick at linuxmafia.com
Tue Oct 18 16:45:40 PDT 2011


----- Forwarded message from Toby Corkindale <toby.corkindale at strategicdata.com.au> -----

Date: Wed, 19 Oct 2011 10:34:32 +1100
From: Toby Corkindale <toby.corkindale at strategicdata.com.au>
To: luv-main at lists.luv.asn.au
Subject: [luv-main] Java memory usage (was: help urgently needed tomorrow
	when I buy new hardware)

On 18/10/11 10:43, Jason White wrote:
> Toby Corkindale<toby.corkindale at 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.

Of that, only 26M was resident, and about 9M of that was shared.


However, if I pass the -Xmx2M flag, indicating I want it to only use 2M 
of memory, it'll still run just fine.  However, it still allocated 373M 
virtual, and 26M resident. So, there's some overhead for the actual Java 
system that's always allocated.

But still.. by default allocating nearly 2GB?! Even with some degree of 
overcommit enabled, that's still crazy!

I ran these tests with OpenJDK 6 and OpenJDK 7.

Versions:
   OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
   OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

   OpenJDK Runtime Environment (IcedTea7 2.0pre (7~b147-2.0~pre6-1ubuntu1)
   OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)


Toby
_______________________________________________
luv-main mailing list
luv-main at lists.luv.asn.au
http://lists.luv.asn.au/listinfo/luv-main

----- End forwarded message -----




More information about the conspire mailing list