src/share/vm/memory/referencePolicy.cpp

changeset 888
c96030fff130
parent 435
a61af66fc99e
child 892
27a80744a83b
     1.1 --- a/src/share/vm/memory/referencePolicy.cpp	Thu Nov 20 12:27:41 2008 -0800
     1.2 +++ b/src/share/vm/memory/referencePolicy.cpp	Thu Nov 20 16:56:09 2008 -0800
     1.3 @@ -26,6 +26,11 @@
     1.4  # include "incls/_referencePolicy.cpp.incl"
     1.5  
     1.6  LRUCurrentHeapPolicy::LRUCurrentHeapPolicy() {
     1.7 +  snap();
     1.8 +}
     1.9 +
    1.10 +// Capture state (of-the-VM) information needed to evaluate the policy
    1.11 +void LRUCurrentHeapPolicy::snap() {
    1.12    _max_interval = (Universe::get_heap_free_at_last_gc() / M) * SoftRefLRUPolicyMSPerMB;
    1.13    assert(_max_interval >= 0,"Sanity check");
    1.14  }
    1.15 @@ -47,6 +52,11 @@
    1.16  /////////////////////// MaxHeap //////////////////////
    1.17  
    1.18  LRUMaxHeapPolicy::LRUMaxHeapPolicy() {
    1.19 +  snap();
    1.20 +}
    1.21 +
    1.22 +// Capture state (of-the-VM) information needed to evaluate the policy
    1.23 +void LRUMaxHeapPolicy::snap() {
    1.24    size_t max_heap = MaxHeapSize;
    1.25    max_heap -= Universe::get_heap_used_at_last_gc();
    1.26    max_heap /= M;

mercurial