dev-java/sun-jdk-1.6.0.31 fails to emerge on x86 with large memory (16GB RAM). See build log. Reproducible: Always Steps to Reproduce: 1. Select an x86 box with large memory (16GB RAM) 2. emerge =dev-java/sun-jdk-1.6.0.31 Actual Results: emerge fails: * ERROR: dev-java/sun-jdk-1.6.0.31 failed (compile phase): * (no error message) * * Call stack: * ebuild.sh, line 85: Called src_compile * environment, line 2538: Called die * The specific snippet of code: * bin/java -server -Xshare:dump || die Expected Results: 1. Select an x86 box with large memory (16GB RAM) 2. emerge =dev-java/sun-jdk-1.6.0.31 3. emerge fails: editing the ebuild and replacing the line: /bin/java -server -Xshare:dump || die with /bin/java -Xms64m -Xmx64m -server -Xshare:dump || die Fixes the issue. This issue also applies to dev-java/sun-jdk-1.6.0.29
Created attachment 302785 [details] emerge --info
Created attachment 302787 [details] build.log
Created attachment 302789 [details] Proposed patch
Comment on attachment 302789 [details] Proposed patch --- /usr/portage/dev-java/sun-jdk/sun-jdk-1.6.0.31.ebuild 2012-02-22 08:52:12.829538211 +0000 +++ /tmp/sun-jdk-1.6.0.31.ebuild 2012-02-22 08:51:55.261810138 +0000 @@ -107,7 +107,7 @@ if use x86; then bin/java -client -Xshare:dump || die fi - bin/java -server -Xshare:dump || die + bin/java -Xms64m -Xmx64m -server -Xshare:dump || die } src_install() {
Created attachment 302791 [details] Proposed patch as diff
This is a specific instance of bug #316121
*** This bug has been marked as a duplicate of bug 316121 ***
Please explain how bug 316121 enables me to emerge dev-java/sun-jdk-1.6.0.31 without modifying the ebuild.
This bug is not resolved by bug 316121.
I am in the same situation (16GB RAM on a 32-bit machine). Adding -Xmx512m to the -server -Xshare:dump line works for me. Interestingly, -Xmx1024m did not work.
(In reply to comment #10) > I am in the same situation (16GB RAM on a 32-bit machine). Adding -Xmx512m to > the -server -Xshare:dump line works for me. Interestingly, -Xmx1024m did not > work. The additional parameters are required to restrict the memory usage, rather than increase it.
(In reply to comment #10) > I am in the same situation (16GB RAM on a 32-bit machine). Adding -Xmx512m to > the -server -Xshare:dump line works for me. Interestingly, -Xmx1024m did not > work. 1GB or 1/4 of available ram, whichever is lower, is the default max for server vm and should work for x86. (Practical maximum is <2GB) -Xmx1024m not working means something is rather odd, may I ask if you can reproduce this issue outside of the ebuild?
(In reply to comment #12) > (In reply to comment #10) > > I am in the same situation (16GB RAM on a 32-bit machine). Adding -Xmx512m to > > the -server -Xshare:dump line works for me. Interestingly, -Xmx1024m did not > > work. > > 1GB or 1/4 of available ram, whichever is lower, is the default max for server > vm and should work for x86. (Practical maximum is <2GB) > > -Xmx1024m not working means something is rather odd, may I ask if you can > reproduce this issue outside of the ebuild? # java -server -Xshare:dump Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. # java -server -version java version "1.6.0_31" Java(TM) SE Runtime Environment (build 1.6.0_31-b04) Java HotSpot(TM) Server VM (build 20.6-b01, mixed mode) #
I was waiting for related bugs to pop up, doesn't seem to happen and so the issue seems to be limited to generating the CDS. Committed the workaround. Thanks for the report.