--- old/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp 2014-04-18 14:34:27.926155440 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp 2014-04-18 14:34:27.862155441 +0200 @@ -84,7 +84,7 @@ } size_t G1CodeRootChunkManager::static_mem_size() { - return sizeof(this); + return sizeof(G1CodeRootChunkManager); } @@ -116,7 +116,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(); } @@ -213,8 +213,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 @@ -224,6 +228,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; @@ -231,6 +238,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 "