src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp

Print this page
rev 6322 : 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
Summary: The test incorrectly assumed that it had been started with no other previous compilation activity. Fix this by allowing multiple code root free chunk lists, and use one separate from the global one to perform the test.
Reviewed-by: brutisso
rev 6329 : 8040792: G1: Memory usage calculation uses sizeof(this) instead of sizeof(classname)
Summary: A few locations in the code use sizeof(this) which returns the size of the pointer instead of sizeof(classname) which returns the size of the sum of its members. This change fixes these errors and adds a few tests.
Reviewed-by: mgerdin, brutisso

*** 145,155 **** void free_all_chunks(FreeList<G1CodeRootChunk>* list); void initialize(); void purge_chunks(size_t keep_ratio); ! size_t static_mem_size(); size_t fl_mem_size(); #ifndef PRODUCT size_t num_chunks_handed_out() const; size_t num_free_chunks() const; --- 145,155 ---- void free_all_chunks(FreeList<G1CodeRootChunk>* list); void initialize(); void purge_chunks(size_t keep_ratio); ! static size_t static_mem_size(); size_t fl_mem_size(); #ifndef PRODUCT size_t num_chunks_handed_out() const; size_t num_free_chunks() const;
*** 184,194 **** G1CodeRootSet(G1CodeRootChunkManager* manager = NULL); ~G1CodeRootSet(); static void purge_chunks(size_t keep_ratio); ! static size_t static_mem_size(); static size_t free_chunks_mem_size(); // Search for the code blob from the recently allocated ones to find duplicates more quickly, as this // method is likely to be repeatedly called with the same nmethod. void add(nmethod* method); --- 184,194 ---- G1CodeRootSet(G1CodeRootChunkManager* manager = NULL); ~G1CodeRootSet(); static void purge_chunks(size_t keep_ratio); ! static size_t free_chunks_static_mem_size(); static size_t free_chunks_mem_size(); // Search for the code blob from the recently allocated ones to find duplicates more quickly, as this // method is likely to be repeatedly called with the same nmethod. void add(nmethod* method);
*** 205,214 **** --- 205,216 ---- bool is_empty() { return length() == 0; } // Length in elements size_t length() const { return _length; } + // Static data memory size in bytes of this set. + static size_t static_mem_size(); // Memory size in bytes taken by this set. size_t mem_size(); static void test() PRODUCT_RETURN; };