8324598: use mem_unit when working with sysinfo memory and swap related information

Reviewed-by: dholmes, mdoerr
This commit is contained in:
Matthias Baesken 2024-01-25 10:36:00 +00:00
parent 6d36eb78ad
commit 7a798d3ceb
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Red Hat, Inc.
* Copyright (c) 2020, 2024, Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,5 +54,5 @@ Java_jdk_internal_platform_CgroupMetrics_getTotalSwapSize0
if (retval < 0) {
return 0; // syinfo failed, treat as no swap
}
return (jlong)si.totalswap;
return (jlong)(si.totalswap * si.mem_unit);
}