mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-07 08:59:07 +00:00
8218733: SA: CollectedHeap provides broken implementation for used() and capacity()
Reviewed-by: shade, jgeorge, eosterlund
This commit is contained in:
parent
ec54717960
commit
797122c227
@ -66,6 +66,16 @@ public class EpsilonHeap extends CollectedHeap {
|
||||
return CollectedHeapName.EPSILON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long capacity() {
|
||||
return space.capacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long used() {
|
||||
return space.used();
|
||||
}
|
||||
|
||||
public ContiguousSpace space() {
|
||||
return space;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -58,8 +58,8 @@ public abstract class CollectedHeap extends VMObject {
|
||||
return reservedRegion().start();
|
||||
}
|
||||
|
||||
public long capacity() { return 0; }
|
||||
public long used() { return 0; }
|
||||
public abstract long capacity();
|
||||
public abstract long used();
|
||||
|
||||
public MemRegion reservedRegion() {
|
||||
return new MemRegion(addr.addOffsetTo(reservedFieldOffset));
|
||||
|
||||
@ -63,6 +63,11 @@ public class ShenandoahHeap extends CollectedHeap {
|
||||
return numRegions.getValue(addr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long capacity() {
|
||||
return numOfRegions() * ShenandoahHeapRegion.regionSizeBytes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long used() {
|
||||
return used.getValue(addr);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -70,6 +70,16 @@ public class ZCollectedHeap extends CollectedHeap {
|
||||
super(addr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long capacity() {
|
||||
return heap().capacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long used() {
|
||||
return heap().used();
|
||||
}
|
||||
|
||||
public OopHandle oop_load_at(OopHandle handle, long offset) {
|
||||
assert(!VM.getVM().isCompressedOopsEnabled());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user