Mercurial > hg > icedtea8-forest > jdk
changeset 14872:e7df66dc154c
8246648: issue with OperatingSystemImpl getFreeSwapSpaceSize in docker after 8242480
Reviewed-by: bobv, sgehwolf
author | mbaesken |
---|---|
date | Mon, 08 Jun 2020 09:29:32 +0200 |
parents | e488620e4191 |
children | 78c875107d40 |
files | src/solaris/classes/sun/management/OperatingSystemImpl.java |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/solaris/classes/sun/management/OperatingSystemImpl.java Wed Sep 23 17:59:08 2020 +0100 +++ b/src/solaris/classes/sun/management/OperatingSystemImpl.java Mon Jun 08 09:29:32 2020 +0200 @@ -65,13 +65,13 @@ if (containerMetrics != null) { long memSwapLimit = containerMetrics.getMemoryAndSwapLimit(); long memLimit = containerMetrics.getMemoryLimit(); - long deltaLimit = memSwapLimit - memLimit; - // Return 0 when memSwapLimit == memLimit, which means no swap space is allowed. - // And the same for memSwapLimit < memLimit. - if (deltaLimit <= 0) { - return 0; - } if (memSwapLimit >= 0 && memLimit >= 0) { + long deltaLimit = memSwapLimit - memLimit; + // Return 0 when memSwapLimit == memLimit, which means no swap space is allowed. + // And the same for memSwapLimit < memLimit. + if (deltaLimit <= 0) { + return 0; + } for (int attempt = 0; attempt < MAX_ATTEMPTS_NUMBER; attempt++) { long memSwapUsage = containerMetrics.getMemoryAndSwapUsage(); long memUsage = containerMetrics.getMemoryUsage();