hotspot/src/share/vm/code/codeCache.cpp
changeset 17617 4e330bce1812
parent 17132 dffd513b2a8c
child 18025 b7bcf7497f93
--- a/hotspot/src/share/vm/code/codeCache.cpp	Fri May 17 09:10:04 2013 -0700
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Thu May 16 15:46:49 2013 +0200
@@ -622,6 +622,15 @@
   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();