Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/metaspaceShared.cpp @ 10183:868d87ed63c8
8008966: NPG: Inefficient Metaspace counter functions cause large young GC regressions
Reviewed-by: mgerdin, coleenp
author | jmasa |
---|---|
date | Tue, 12 Feb 2013 14:15:45 -0800 |
parents | c793367610c1 |
children | a1ebd310d5c1 |
comparison
equal
deleted
inserted
replaced
10182:5c93c1f61226 | 10183:868d87ed63c8 |
---|---|
374 | 374 |
375 // Print shared spaces all the time | 375 // Print shared spaces all the time |
376 const char* fmt = "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT; | 376 const char* fmt = "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT; |
377 Metaspace* ro_space = _loader_data->ro_metaspace(); | 377 Metaspace* ro_space = _loader_data->ro_metaspace(); |
378 Metaspace* rw_space = _loader_data->rw_metaspace(); | 378 Metaspace* rw_space = _loader_data->rw_metaspace(); |
379 const size_t BPW = BytesPerWord; | |
380 | 379 |
381 // Allocated size of each space (may not be all occupied) | 380 // Allocated size of each space (may not be all occupied) |
382 const size_t ro_alloced = ro_space->capacity_words(Metaspace::NonClassType) * BPW; | 381 const size_t ro_alloced = ro_space->capacity_bytes_slow(Metaspace::NonClassType); |
383 const size_t rw_alloced = rw_space->capacity_words(Metaspace::NonClassType) * BPW; | 382 const size_t rw_alloced = rw_space->capacity_bytes_slow(Metaspace::NonClassType); |
384 const size_t md_alloced = md_end-md_low; | 383 const size_t md_alloced = md_end-md_low; |
385 const size_t mc_alloced = mc_end-mc_low; | 384 const size_t mc_alloced = mc_end-mc_low; |
386 const size_t total_alloced = ro_alloced + rw_alloced + md_alloced + mc_alloced; | 385 const size_t total_alloced = ro_alloced + rw_alloced + md_alloced + mc_alloced; |
387 | 386 |
388 // Occupied size of each space. | 387 // Occupied size of each space. |
389 const size_t ro_bytes = ro_space->used_words(Metaspace::NonClassType) * BPW; | 388 const size_t ro_bytes = ro_space->used_bytes_slow(Metaspace::NonClassType); |
390 const size_t rw_bytes = rw_space->used_words(Metaspace::NonClassType) * BPW; | 389 const size_t rw_bytes = rw_space->used_bytes_slow(Metaspace::NonClassType); |
391 const size_t md_bytes = size_t(md_top - md_low); | 390 const size_t md_bytes = size_t(md_top - md_low); |
392 const size_t mc_bytes = size_t(mc_top - mc_low); | 391 const size_t mc_bytes = size_t(mc_top - mc_low); |
393 | 392 |
394 // Percent of total size | 393 // Percent of total size |
395 const size_t total_bytes = ro_bytes + rw_bytes + md_bytes + mc_bytes; | 394 const size_t total_bytes = ro_bytes + rw_bytes + md_bytes + mc_bytes; |