Mercurial > hg > truffle
comparison src/share/vm/memory/metaspace.cpp @ 12302:9361de86a50f
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 | 8c5e6482cbfc |
children | b960c9df4f11 |
comparison
equal
deleted
inserted
replaced
12301:2c022e432e10 | 12302:9361de86a50f |
---|---|
1340 // for non-class virtual space, compare against virtual spaces that are reserved. | 1340 // for non-class virtual space, compare against virtual spaces that are reserved. |
1341 // For class virtual space, we only compare against the committed space, not | 1341 // For class virtual space, we only compare against the committed space, not |
1342 // reserved space, because this is a larger space prereserved for compressed | 1342 // reserved space, because this is a larger space prereserved for compressed |
1343 // class pointers. | 1343 // class pointers. |
1344 if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) { | 1344 if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) { |
1345 size_t real_allocated = Metaspace::space_list()->reserved_words() + | 1345 size_t nonclass_allocated = MetaspaceAux::reserved_bytes(Metaspace::NonClassType); |
1346 MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); | 1346 size_t class_allocated = MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); |
1347 size_t real_allocated = nonclass_allocated + class_allocated; | |
1347 if (real_allocated >= MaxMetaspaceSize) { | 1348 if (real_allocated >= MaxMetaspaceSize) { |
1348 return false; | 1349 return false; |
1349 } | 1350 } |
1350 } | 1351 } |
1351 | 1352 |