mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
6684579: SoftReference processing can be made more efficient
For current soft-ref clearing policies, we can decide at marking time if a soft-reference will definitely not be cleared, postponing the decision of whether it will definitely be cleared to the final reference processing phase. This can be especially beneficial in the case of concurrent collectors where the marking is usually concurrent but reference processing is usually not. Reviewed-by: jmasa
This commit is contained in:
parent
db6bef2c70
commit
7d7cf3f8af
18 changed files with 137 additions and 164 deletions
|
@ -26,9 +26,11 @@
|
|||
// should be cleared.
|
||||
|
||||
|
||||
class ReferencePolicy : public ResourceObj {
|
||||
class ReferencePolicy : public CHeapObj {
|
||||
public:
|
||||
virtual bool should_clear_reference(oop p) { ShouldNotReachHere(); return true; }
|
||||
// Capture state (of-the-VM) information needed to evaluate the policy
|
||||
virtual void snap() { /* do nothing */ }
|
||||
};
|
||||
|
||||
class NeverClearPolicy : public ReferencePolicy {
|
||||
|
@ -48,6 +50,8 @@ class LRUCurrentHeapPolicy : public ReferencePolicy {
|
|||
public:
|
||||
LRUCurrentHeapPolicy();
|
||||
|
||||
// Capture state (of-the-VM) information needed to evaluate the policy
|
||||
void snap();
|
||||
bool should_clear_reference(oop p);
|
||||
};
|
||||
|
||||
|
@ -58,5 +62,7 @@ class LRUMaxHeapPolicy : public ReferencePolicy {
|
|||
public:
|
||||
LRUMaxHeapPolicy();
|
||||
|
||||
// Capture state (of-the-VM) information needed to evaluate the policy
|
||||
void snap();
|
||||
bool should_clear_reference(oop p);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue