// referencePolicy is used to determine when soft reference objects // should be cleared.
class ReferencePolicy : public CHeapObj<mtGC> { public: virtualbool should_clear_reference(oop p, jlong timestamp_clock) {
ShouldNotReachHere(); returntrue;
}
// Capture state (of-the-VM) information needed to evaluate the policy virtualvoid setup() { /* do nothing */ }
};
class NeverClearPolicy : public ReferencePolicy { public: virtualbool should_clear_reference(oop p, jlong timestamp_clock) { returnfalse;
}
};
class AlwaysClearPolicy : public ReferencePolicy { public: virtualbool should_clear_reference(oop p, jlong timestamp_clock) { returntrue;
}
};
class LRUCurrentHeapPolicy : public ReferencePolicy { private:
jlong _max_interval;
public:
LRUCurrentHeapPolicy();
// Capture state (of-the-VM) information needed to evaluate the policy void setup(); virtualbool should_clear_reference(oop p, jlong timestamp_clock);
};
class LRUMaxHeapPolicy : public ReferencePolicy { private:
jlong _max_interval;
public:
LRUMaxHeapPolicy();
// Capture state (of-the-VM) information needed to evaluate the policy void setup(); virtualbool should_clear_reference(oop p, jlong timestamp_clock);
};
#endif// SHARE_GC_SHARED_REFERENCEPOLICY_HPP
Messung V0.5 in Prozent
[Verzeichnis aufwärts0.12unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-10-11]