src/share/vm/code/codeCache.cpp

Print this page
rev 4616 : fixes fill up of code cache: added command line parameter which defines a
threshold (percentage of used code cache) at which the threshold for
recompilation is increased.

*** 620,629 **** --- 620,638 ---- address CodeCache::last_address() { assert_locked_or_safepoint(CodeCache_lock); return (address)_heap->high(); } + /** + * Returns the reverse free ratio. E.g., if 25% (1/4) of the code cache + * is free, reverse_free_ratio() returns 4. + */ + double CodeCache::reverse_free_ratio() { + double unallocated_capacity = (double)(CodeCache::unallocated_capacity() - CodeCacheMinimumFreeSpace); + double max_capacity = (double)CodeCache::max_capacity(); + return max_capacity / unallocated_capacity; + } void icache_init(); void CodeCache::initialize() { assert(CodeCacheSegmentSize >= (uintx)CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points");