--- old/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp 2014-07-16 15:29:08.473872684 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp 2014-07-16 15:29:08.377871568 +0200 @@ -86,7 +86,7 @@ } size_t G1CodeRootChunkManager::static_mem_size() { - return sizeof(this); + return sizeof(G1CodeRootChunkManager); } @@ -118,7 +118,7 @@ _default_chunk_manager.purge_chunks(keep_ratio); } -size_t G1CodeRootSet::static_mem_size() { +size_t G1CodeRootSet::free_chunks_static_mem_size() { return _default_chunk_manager.static_mem_size(); } @@ -215,8 +215,12 @@ } } +size_t G1CodeRootSet::static_mem_size() { + return sizeof(G1CodeRootSet); +} + size_t G1CodeRootSet::mem_size() { - return sizeof(this) + _list.count() * _list.size(); + return G1CodeRootSet::static_mem_size() + _list.count() * _list.size(); } #ifndef PRODUCT @@ -226,6 +230,9 @@ assert(mgr.num_chunks_handed_out() == 0, "Must not have handed out chunks yet"); + assert(G1CodeRootChunkManager::static_mem_size() > sizeof(void*), + err_msg("The chunk manager's static memory usage seems too small, is only "SIZE_FORMAT" bytes.", G1CodeRootChunkManager::static_mem_size())); + // The number of chunks that we allocate for purge testing. size_t const num_chunks = 10; @@ -233,6 +240,9 @@ G1CodeRootSet set1(&mgr); assert(set1.is_empty(), "Code root set must be initially empty but is not."); + assert(G1CodeRootSet::static_mem_size() > sizeof(void*), + err_msg("The code root set's static memory usage seems too small, is only "SIZE_FORMAT" bytes", G1CodeRootSet::static_mem_size())); + set1.add((nmethod*)1); assert(mgr.num_chunks_handed_out() == 1, err_msg("Must have allocated and handed out one chunk, but handed out "