openjdk,icedtea - Xmx option mandatory

Mark Wielaard mark at
Mon Aug 11 04:05:24 PDT 2008

Hi Roberto,

On Sat, 2008-08-09 at 01:33 +0200, Roberto Mannai wrote:
> In the while, I downloaded from:
> the last factory opensuse java version.
> If I'm not wrong, the Xmx setting is done into the file:
> openjdk-6-src-b09-11_apr_2008-fedora/openjdk/jdk/make/docs/Makefile
> Where the default size should be:
> That default value makes the process crash on my PC, which has 512 mb
> of RAM (java -Xmx512m -version crashes, too).

That is not the place where the memory settings for the runtime java are
done. Look at openjdk/hotspot/src/share/vm/runtime/arguments.cpp where
there are a couple of functions trying to figure out some reasonable max
memory size. In particular they try to use os::physical_memory() and
os::allocatable_physical_memory to get a nice fraction of memory based
on what you actually have in your machine. It seems something is failing

In one of your traces that you posted at:
You see that the java launcher tries to allocate (mmap2) 
603979776 bytes aka 576 MB on your machine, just before the failure,
which you clearly don't have. 

If you could help us figure out where/what precisely is guessing
something wrong for your setup that would be nice. I don't immediately
have a suggestion. But start by tracing which of the os::*memory()
functions in openjdk/hotspot/src/os_cpu/*/vm/os_*.cpp are called and
what they return in your setup would be a good start.

There seems to be a second bug during the cleanup after the abort
because of too limited memory. That is the "** glibc detected *** java:
free(): invalid pointer" you are seeing. Something is probably freeing
something that was never allocated in this case.



More information about the distro-pkg-dev mailing list