comparison src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp @ 20218:828056cf311f

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
author tschatzl
date Mon, 21 Jul 2014 09:40:19 +0200
parents 82693fb204a5
children 2c6ef90f030a
comparison
equal deleted inserted replaced
20217:6b52700a896b 20218:828056cf311f
145 void free_all_chunks(FreeList<G1CodeRootChunk>* list); 145 void free_all_chunks(FreeList<G1CodeRootChunk>* list);
146 146
147 void initialize(); 147 void initialize();
148 void purge_chunks(size_t keep_ratio); 148 void purge_chunks(size_t keep_ratio);
149 149
150 size_t static_mem_size(); 150 static size_t static_mem_size();
151 size_t fl_mem_size(); 151 size_t fl_mem_size();
152 152
153 #ifndef PRODUCT 153 #ifndef PRODUCT
154 size_t num_chunks_handed_out() const; 154 size_t num_chunks_handed_out() const;
155 size_t num_free_chunks() const; 155 size_t num_free_chunks() const;
184 G1CodeRootSet(G1CodeRootChunkManager* manager = NULL); 184 G1CodeRootSet(G1CodeRootChunkManager* manager = NULL);
185 ~G1CodeRootSet(); 185 ~G1CodeRootSet();
186 186
187 static void purge_chunks(size_t keep_ratio); 187 static void purge_chunks(size_t keep_ratio);
188 188
189 static size_t static_mem_size(); 189 static size_t free_chunks_static_mem_size();
190 static size_t free_chunks_mem_size(); 190 static size_t free_chunks_mem_size();
191 191
192 // Search for the code blob from the recently allocated ones to find duplicates more quickly, as this 192 // Search for the code blob from the recently allocated ones to find duplicates more quickly, as this
193 // method is likely to be repeatedly called with the same nmethod. 193 // method is likely to be repeatedly called with the same nmethod.
194 void add(nmethod* method); 194 void add(nmethod* method);
205 bool is_empty() { return length() == 0; } 205 bool is_empty() { return length() == 0; }
206 206
207 // Length in elements 207 // Length in elements
208 size_t length() const { return _length; } 208 size_t length() const { return _length; }
209 209
210 // Static data memory size in bytes of this set.
211 static size_t static_mem_size();
210 // Memory size in bytes taken by this set. 212 // Memory size in bytes taken by this set.
211 size_t mem_size(); 213 size_t mem_size();
212 214
213 static void test() PRODUCT_RETURN; 215 static void test() PRODUCT_RETURN;
214 }; 216 };