mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-12 05:25:07 +00:00
8386323: Remove unused MemoryPool allocation availability state
Reviewed-by: stefank, tschatzl, jsikstro
This commit is contained in:
parent
0fe051d305
commit
3f44d03e8a
@ -32,7 +32,7 @@ PSOldGenerationPool::PSOldGenerationPool(PSOldGen* old_gen,
|
||||
}
|
||||
|
||||
MemoryUsage PSOldGenerationPool::get_memory_usage() {
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = _old_gen->capacity_in_bytes();
|
||||
|
||||
@ -59,7 +59,7 @@ PSEdenSpacePool::PSEdenSpacePool(PSYoungGen* young_gen,
|
||||
}
|
||||
|
||||
MemoryUsage PSEdenSpacePool::get_memory_usage() {
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = _space->capacity_in_bytes();
|
||||
|
||||
@ -80,7 +80,7 @@ PSSurvivorSpacePool::PSSurvivorSpacePool(PSYoungGen* young_gen,
|
||||
}
|
||||
|
||||
MemoryUsage PSSurvivorSpacePool::get_memory_usage() {
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = committed_in_bytes();
|
||||
return MemoryUsage(initial_size(), used, committed, maxSize);
|
||||
|
||||
@ -40,7 +40,7 @@ size_t ContiguousSpacePool::used_in_bytes() {
|
||||
}
|
||||
|
||||
MemoryUsage ContiguousSpacePool::get_memory_usage() {
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = _space->capacity();
|
||||
|
||||
@ -64,7 +64,7 @@ size_t SurvivorContiguousSpacePool::committed_in_bytes() {
|
||||
}
|
||||
|
||||
MemoryUsage SurvivorContiguousSpacePool::get_memory_usage() {
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = committed_in_bytes();
|
||||
|
||||
@ -85,7 +85,7 @@ size_t TenuredGenerationPool::used_in_bytes() {
|
||||
MemoryUsage TenuredGenerationPool::get_memory_usage() {
|
||||
size_t used = used_in_bytes();
|
||||
size_t committed = _gen->capacity();
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
|
||||
return MemoryUsage(initial_size(), used, committed, maxSize);
|
||||
}
|
||||
|
||||
@ -51,7 +51,6 @@ MemoryPool::MemoryPool(const char* name,
|
||||
_type(type),
|
||||
_initial_size(init_size),
|
||||
_max_size(max_size),
|
||||
_available_for_allocation(true),
|
||||
_managers(),
|
||||
_num_managers(0),
|
||||
_peak_usage(),
|
||||
@ -188,7 +187,7 @@ MemoryUsage CodeHeapPool::get_memory_usage() {
|
||||
size_t used = used_in_bytes();
|
||||
OrderAccess::acquire(); // ensure possible cache expansion in CodeCache::allocate is seen
|
||||
size_t committed = _codeHeap->capacity();
|
||||
size_t maxSize = (available_for_allocation() ? max_size() : 0);
|
||||
size_t maxSize = max_size();
|
||||
|
||||
return MemoryUsage(initial_size(), used, committed, maxSize);
|
||||
}
|
||||
|
||||
@ -61,7 +61,6 @@ class MemoryPool : public CHeapObj<mtInternal> {
|
||||
PoolType _type;
|
||||
size_t _initial_size;
|
||||
size_t _max_size;
|
||||
bool _available_for_allocation; // Default is true
|
||||
MemoryManager* _managers[max_num_managers];
|
||||
int _num_managers;
|
||||
MemoryUsage _peak_usage; // Peak memory usage
|
||||
@ -98,13 +97,6 @@ class MemoryPool : public CHeapObj<mtInternal> {
|
||||
|
||||
bool is_pool(instanceHandle pool) const;
|
||||
|
||||
bool available_for_allocation() { return _available_for_allocation; }
|
||||
bool set_available_for_allocation(bool value) {
|
||||
bool prev = _available_for_allocation;
|
||||
_available_for_allocation = value;
|
||||
return prev;
|
||||
}
|
||||
|
||||
MemoryManager* get_memory_manager(int index) {
|
||||
assert(index >= 0 && index < _num_managers, "Invalid index");
|
||||
return _managers[index];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user