mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8222462: Introduce CollectedHeap::unused()
Reviewed-by: stefank, eosterlund
This commit is contained in:
parent
72491e961c
commit
2accc59e60
9 changed files with 25 additions and 6 deletions
|
@ -508,12 +508,7 @@ JVM_END
|
|||
|
||||
JVM_ENTRY_NO_ENV(jlong, JVM_FreeMemory(void))
|
||||
JVMWrapper("JVM_FreeMemory");
|
||||
CollectedHeap* ch = Universe::heap();
|
||||
size_t n;
|
||||
{
|
||||
MutexLocker x(Heap_lock);
|
||||
n = ch->capacity() - ch->used();
|
||||
}
|
||||
size_t n = Universe::heap()->unused();
|
||||
return convert_size_t_to_jlong(n);
|
||||
JVM_END
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue