[Bug 2612] 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
Mon Sep 7 14:54:50 UTC 2015


            Bug ID: 2612
           Summary: CACAO has a fixed default max heap, unlike HotSpot
                    which adapts to physical memory
           Product: IcedTea
           Version: 2.6.1
          Hardware: all
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: CACAO
          Assignee: gnu.andrew at redhat.com
          Reporter: chewi at gentoo.org
                CC: unassigned at icedtea.classpath.org, xerxes at zafena.se

Created attachment 1415
  --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=1415&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 in (c182f119eaad) although
CACAO is broken in this IcedTea version 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/20150907/eb41a042/attachment-0001.html>

More information about the distro-pkg-dev mailing list