[Bug 2611] New: CACAO has a fixed default max heap, unlike HotSpot which adapts to physical memory

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Sun Sep 6 18:28:47 UTC 2015


            Bug ID: 2611
           Summary: CACAO has a fixed default max heap, unlike HotSpot
                    which adapts to physical memory
           Product: IcedTea
           Version: 7-hg
          Hardware: all
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: CACAO
          Assignee: stefan at complang.tuwien.ac.at
          Reporter: chewi at gentoo.org
                CC: unassigned at icedtea.classpath.org, xerxes at zafena.se

Created attachment 1414
  --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=1414&action=edit

We have long had problems with CACAO failing to build Gentoo packages due to
OutOfMemory errors where HotSpot would otherwise succeed. gnu_andrew told me
that this is because CACAO uses more memory, though perhaps I misunderstood.
When I looked closer, I found this assertion didn't stack up because on Linux,
Java normally sets the maximum heap size to a 1/4 of physical RAM or 2GB,
whichever is smaller. CACAO was failing to build bcprov on a system with 16GB
RAM and yet it worked when I specified -Xmx256m. java -XshowSettings:vm told me

VM settings:
    Max. Heap Size (Estimated): 128.00M
    Ergonomics Machine Class: server
    Using VM: CACAO

Ah. :) Digging into the CACAO code, I found that it sets the maximum heap size
to 128MB unconditionally. I suppose this is reasonable for standalone CACAO but
for IcedTea, which is supposed to be a general purpose VM, this seems woefully

Attached is a patch that can be placed in patches/cacao to make it calculate
1/4 of the physical RAM on Linux in more or less the same way that HotSpot does
and use that if it's greater than 128MB and -Xmx hasn't been given. I've been
careful to avoid overflows as for some reason, the variable used here is a
signed 32-bit int.

This applies against the CACAO version used is (68fe50ac34ec) and (e215e36be9fc) but not (c182f119eaad). The latter is broken
under CACAO anyway.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20150906/e8cb99db/attachment.html>

More information about the distro-pkg-dev mailing list