changeset 20080:bd8cf4788384

8025059: Metspace::should_expand mixes bytes and words in check against MaxMetaspaceSize Reviewed-by: coleenp, brutisso, mgerdin, jmasa
author stefank
date Fri, 20 Sep 2013 11:00:38 +0200
parents edbc2f7b38ef
children e26536e86a5c
files hotspot/src/share/vm/memory/metaspace.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Fri Sep 20 10:53:28 2013 +0200
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Fri Sep 20 11:00:38 2013 +0200
@@ -1342,8 +1342,9 @@
   // reserved space, because this is a larger space prereserved for compressed
   // class pointers.
   if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) {
-    size_t real_allocated = Metaspace::space_list()->reserved_words() +
-              MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType);
+    size_t nonclass_allocated = MetaspaceAux::reserved_bytes(Metaspace::NonClassType);
+    size_t class_allocated    = MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType);
+    size_t real_allocated     = nonclass_allocated + class_allocated;
     if (real_allocated >= MaxMetaspaceSize) {
       return false;
     }