mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8300119: CgroupMetrics.getTotalMemorySize0() can report invalid results on 32 bit systems
Reviewed-by: sgehwolf
This commit is contained in:
parent
2e4a3c47e2
commit
dea58efb62
1 changed files with 3 additions and 1 deletions
|
@ -39,5 +39,7 @@ JNIEXPORT jlong JNICALL
|
|||
Java_jdk_internal_platform_CgroupMetrics_getTotalMemorySize0
|
||||
(JNIEnv *env, jclass ignored)
|
||||
{
|
||||
return sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
|
||||
jlong pages = sysconf(_SC_PHYS_PAGES);
|
||||
jlong page_size = sysconf(_SC_PAGESIZE);
|
||||
return pages * page_size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue