From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 50DD41386C9 for ; Mon, 7 Sep 2015 22:43:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A6281425B; Mon, 7 Sep 2015 22:43:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 266E31425B for ; Mon, 7 Sep 2015 22:43:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 10675340A5D for ; Mon, 7 Sep 2015 22:43:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D8AA618D for ; Mon, 7 Sep 2015 22:43:49 +0000 (UTC) From: "James Le Cuirot" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "James Le Cuirot" Message-ID: <1441665822.6804ed55a394fbfbb178da4caccfb832a617357e.chewi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/icedtea/files/, dev-java/icedtea/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/icedtea/files/6-cacao-dynmaxheap-Makefile.patch dev-java/icedtea/files/6-cacao-dynmaxheap.patch dev-java/icedtea/files/7-cacao-dynmaxheap-Makefile.patch dev-java/icedtea/files/7-cacao-dynmaxheap.patch dev-java/icedtea/icedtea-6.1.13.8-r1.ebuild dev-java/icedtea/icedtea-6.1.13.8.ebuild dev-java/icedtea/icedtea-7.2.5.6-r1.ebuild dev-java/icedtea/icedtea-7.2.5.6.ebuild X-VCS-Directories: dev-java/icedtea/files/ dev-java/icedtea/ X-VCS-Committer: chewi X-VCS-Committer-Name: James Le Cuirot X-VCS-Revision: 6804ed55a394fbfbb178da4caccfb832a617357e X-VCS-Branch: master Date: Mon, 7 Sep 2015 22:43:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a18b0756-7da6-4245-aac5-f4894a74f213 X-Archives-Hash: fc26c6ca7bf20902e3c433fbfd9e4453 commit: 6804ed55a394fbfbb178da4caccfb832a617357e Author: James Le Cuirot gentoo org> AuthorDate: Mon Sep 7 22:42:34 2015 +0000 Commit: James Le Cuirot gentoo org> CommitDate: Mon Sep 7 22:43:42 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6804ed55 dev-java/icedtea: Patch CACAO for a dynamic maximum heap It has been discovered that CACAO has been giving us memory problems because it had a fixed default heap size of only 128MB, whereas HotSpot uses a quarter of the physical RAM. I have patched CACAO to do the same. See IcedTea bugs #2611 and #2612. Package-Manager: portage-2.2.20.1 .../files/6-cacao-dynmaxheap-Makefile.patch | 10 ++++++ dev-java/icedtea/files/6-cacao-dynmaxheap.patch | 42 ++++++++++++++++++++++ .../files/7-cacao-dynmaxheap-Makefile.patch | 10 ++++++ dev-java/icedtea/files/7-cacao-dynmaxheap.patch | 42 ++++++++++++++++++++++ ...-6.1.13.8.ebuild => icedtea-6.1.13.8-r1.ebuild} | 4 +++ ...ea-7.2.5.6.ebuild => icedtea-7.2.5.6-r1.ebuild} | 4 +++ 6 files changed, 112 insertions(+) diff --git a/dev-java/icedtea/files/6-cacao-dynmaxheap-Makefile.patch b/dev-java/icedtea/files/6-cacao-dynmaxheap-Makefile.patch new file mode 100644 index 0000000..dc87ae8 --- /dev/null +++ b/dev-java/icedtea/files/6-cacao-dynmaxheap-Makefile.patch @@ -0,0 +1,10 @@ +--- Makefile.in.orig 2015-07-28 07:21:16.447388803 -0700 ++++ Makefile.in 2015-09-06 09:13:16.548000000 -0700 +@@ -182,6 +182,7 @@ + @WITH_RHINO_TRUE@ patches/rhino.patch + + @BUILD_CACAO_TRUE@am__append_22 = \ ++@BUILD_CACAO_TRUE@ patches/cacao/dynmaxheap.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/launcher.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/memory.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/hotspot/original/memory.patch \ diff --git a/dev-java/icedtea/files/6-cacao-dynmaxheap.patch b/dev-java/icedtea/files/6-cacao-dynmaxheap.patch new file mode 100644 index 0000000..33b9818 --- /dev/null +++ b/dev-java/icedtea/files/6-cacao-dynmaxheap.patch @@ -0,0 +1,42 @@ +# HG changeset patch +# User James Le Cuirot +# Date 1441543564 -3600 +# Sun Sep 06 13:46:04 2015 +0100 +# Node ID d0224f4490d6694e77dcb0ff7eae8e2297b822bf +# Parent e215e36be9fc2b7dfe43ff10ec1afe639b289aa5 +Dynamically set the maximum heap size on Linux + +diff -r e215e36be9fc -r d0224f4490d6 src/vm/vm.cpp +--- cacao/cacao/src/vm/vm.cpp Mon Feb 11 19:31:28 2013 +0100 ++++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:46:04 2015 +0100 +@@ -33,6 +33,10 @@ + #include + #include + ++#if defined(__LINUX__) ++#include ++#endif ++ + #include "vm/types.h" + + #include "arch.h" +@@ -702,6 +706,19 @@ + opt_heapstartsize = HEAP_STARTSIZE; + opt_stacksize = STACK_SIZE; + ++#if defined(__LINUX__) ++ // Calculate 1/4 of the physical memory. ++ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; ++ ++ if (qmem > INT32_MAX) { ++ // More than 2GB will overflow so cap it. ++ opt_heapmaxsize = 2047 * 1024 * 1024; ++ } else if (qmem > HEAP_MAXSIZE) { ++ // Otherwise use this if greater than default (128MB). ++ opt_heapmaxsize = (s4) qmem; ++ } ++#endif ++ + // First of all, parse the -XX options. + + #if defined(ENABLE_VMLOG) diff --git a/dev-java/icedtea/files/7-cacao-dynmaxheap-Makefile.patch b/dev-java/icedtea/files/7-cacao-dynmaxheap-Makefile.patch new file mode 100644 index 0000000..13e3053 --- /dev/null +++ b/dev-java/icedtea/files/7-cacao-dynmaxheap-Makefile.patch @@ -0,0 +1,10 @@ +--- Makefile.in.orig 2015-07-22 14:54:37.116940780 -0700 ++++ Makefile.in 2015-09-06 05:05:47.220000000 -0700 +@@ -134,6 +134,7 @@ + @WITH_RHINO_TRUE@ patches/rhino.patch + + @BUILD_CACAO_TRUE@am__append_10 = \ ++@BUILD_CACAO_TRUE@ patches/cacao/dynmaxheap.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/launcher.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/memory.patch \ + @BUILD_CACAO_TRUE@ patches/cacao/armhf.patch \ diff --git a/dev-java/icedtea/files/7-cacao-dynmaxheap.patch b/dev-java/icedtea/files/7-cacao-dynmaxheap.patch new file mode 100644 index 0000000..33b9818 --- /dev/null +++ b/dev-java/icedtea/files/7-cacao-dynmaxheap.patch @@ -0,0 +1,42 @@ +# HG changeset patch +# User James Le Cuirot +# Date 1441543564 -3600 +# Sun Sep 06 13:46:04 2015 +0100 +# Node ID d0224f4490d6694e77dcb0ff7eae8e2297b822bf +# Parent e215e36be9fc2b7dfe43ff10ec1afe639b289aa5 +Dynamically set the maximum heap size on Linux + +diff -r e215e36be9fc -r d0224f4490d6 src/vm/vm.cpp +--- cacao/cacao/src/vm/vm.cpp Mon Feb 11 19:31:28 2013 +0100 ++++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:46:04 2015 +0100 +@@ -33,6 +33,10 @@ + #include + #include + ++#if defined(__LINUX__) ++#include ++#endif ++ + #include "vm/types.h" + + #include "arch.h" +@@ -702,6 +706,19 @@ + opt_heapstartsize = HEAP_STARTSIZE; + opt_stacksize = STACK_SIZE; + ++#if defined(__LINUX__) ++ // Calculate 1/4 of the physical memory. ++ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; ++ ++ if (qmem > INT32_MAX) { ++ // More than 2GB will overflow so cap it. ++ opt_heapmaxsize = 2047 * 1024 * 1024; ++ } else if (qmem > HEAP_MAXSIZE) { ++ // Otherwise use this if greater than default (128MB). ++ opt_heapmaxsize = (s4) qmem; ++ } ++#endif ++ + // First of all, parse the -XX options. + + #if defined(ENABLE_VMLOG) diff --git a/dev-java/icedtea/icedtea-6.1.13.8.ebuild b/dev-java/icedtea/icedtea-6.1.13.8-r1.ebuild similarity index 97% rename from dev-java/icedtea/icedtea-6.1.13.8.ebuild rename to dev-java/icedtea/icedtea-6.1.13.8-r1.ebuild index 745d54b..ff53a11 100644 --- a/dev-java/icedtea/icedtea-6.1.13.8.ebuild +++ b/dev-java/icedtea/icedtea-6.1.13.8-r1.ebuild @@ -152,6 +152,10 @@ src_unpack() { } java_prepare() { + # CACAO has a fixed default max heap of 128MB. This sucks. + cp "${FILESDIR}"/${SLOT}-cacao-dynmaxheap.patch patches/cacao/dynmaxheap.patch || die + epatch "${FILESDIR}"/${SLOT}-cacao-dynmaxheap-Makefile.patch + # For bootstrap builds as the sandbox control file might not yet exist. addpredict /proc/self/coredump_filter diff --git a/dev-java/icedtea/icedtea-7.2.5.6.ebuild b/dev-java/icedtea/icedtea-7.2.5.6-r1.ebuild similarity index 98% rename from dev-java/icedtea/icedtea-7.2.5.6.ebuild rename to dev-java/icedtea/icedtea-7.2.5.6-r1.ebuild index 06dbc68..d8a172f 100644 --- a/dev-java/icedtea/icedtea-7.2.5.6.ebuild +++ b/dev-java/icedtea/icedtea-7.2.5.6-r1.ebuild @@ -196,6 +196,10 @@ src_unpack() { } java_prepare() { + # CACAO has a fixed default max heap of 128MB. This sucks. + cp "${FILESDIR}"/${SLOT}-cacao-dynmaxheap.patch patches/cacao/dynmaxheap.patch || die + epatch "${FILESDIR}"/${SLOT}-cacao-dynmaxheap-Makefile.patch + if ! use cups; then # CUPS is always needed at build time but you can at least make it dlopen. sed -i 's/SYSTEM_CUPS="true"/SYSTEM_CUPS="false"/g' Makefile.in || die