Scale down the metaspace reservation for compressed class pointers.

This allows the JVM to work properly in a 2GB VA limit. Bump revision.
This commit is contained in:
joerg 2015-08-27 19:03:59 +00:00
parent fdc57c6fda
commit b73b4920f2
3 changed files with 27 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.19 2015/08/09 17:29:52 ryoon Exp $
# $NetBSD: Makefile,v 1.20 2015/08/27 19:03:59 joerg Exp $
DISTNAME= openjdk-1.8.51-20150806
PKGNAME= openjdk8-1.8.51
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL:=openjdk7/}
EXTRACT_SUFX= .tar.xz

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.24 2015/08/09 17:29:52 ryoon Exp $
$NetBSD: distinfo,v 1.25 2015/08/27 19:03:59 joerg Exp $
SHA1 (openjdk7/bootstrap-jdk-1.7.76-freebsd-10-amd64-20150301.tar.xz) = 7408f52d3bbe35c2b14bbd3215cbf60f1335d334
RMD160 (openjdk7/bootstrap-jdk-1.7.76-freebsd-10-amd64-20150301.tar.xz) = 24f1577b5fc86d137f070aedb4610c8c89e45815
@ -84,6 +84,7 @@ SHA1 (patch-hotspot_src_os_solaris_vm_perfMemory__solaris.cpp) = 589bf0707023b9f
SHA1 (patch-hotspot_src_share_vm_ci_ciTypeFlow.cpp) = 2d827ade6fcf0ba08fcd0390472cda17772bc0c5
SHA1 (patch-hotspot_src_share_vm_interpreter_interpreterRuntime.cpp) = d2eaaae414810ab460ced512fdfc07385d60f4b8
SHA1 (patch-hotspot_src_share_vm_opto_node.cpp) = aacb4e03f62f1a6f9b38de39a966c318b70b1293
SHA1 (patch-hotspot_src_share_vm_runtime_arguments.cpp) = 80265396c62de95b0937d770c1dba0e8a53daa80
SHA1 (patch-hotspot_src_share_vm_utilities_globalDefinitions__gcc.hpp) = f35b8c1a1841f1239aa25d58d0b8749bb7b29ad2
SHA1 (patch-hotspot_src_share_vm_utilities_hashtable.cpp) = 83b90d951ce3aa9e913a36d792ac7376fb3d8bc7
SHA1 (patch-jdk_make_CompileDemos.gmk) = 4d5e2e9b0e35e373e6246408c775c25094b6f1c7

View file

@ -0,0 +1,23 @@
$NetBSD: patch-hotspot_src_share_vm_runtime_arguments.cpp,v 1.1 2015/08/27 19:03:59 joerg Exp $
On 64bit systems, the JVM by default reserves 1GB VA to mangle class
pointers into a 32bit representation. When the available memory is less
than 16GB, e.g. due to process limits, scale this down. Even unused
pages waste system resources and the default limit can stop the JVM
from starting with ulimit -v 2G.
--- hotspot/src/share/vm/runtime/arguments.cpp.orig 2015-08-26 15:02:34.000000000 +0000
+++ hotspot/src/share/vm/runtime/arguments.cpp
@@ -1808,6 +1808,12 @@ void Arguments::set_heap_size() {
FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
}
+ if (FLAG_IS_DEFAULT(CompressedClassSpaceSize)) {
+ julong reasonable_max = phys_mem / 16;
+ reasonable_max = MIN2(reasonable_max, (julong)CompressedClassSpaceSize);
+ FLAG_SET_ERGO(uintx, CompressedClassSpaceSize, (uintx)reasonable_max);
+ }
+
// If the minimum or initial heap_size have not been set or requested to be set
// ergonomically, set them accordingly.
if (InitialHeapSize == 0 || min_heap_size() == 0) {