RFR [XS]: 8244500: jtreg test error in test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java
Severin Gehwolf
sgehwolf at redhat.com
Fri May 22 09:10:07 UTC 2020
Hi Bob,
On Wed, 2020-05-20 at 16:16 -0400, Bob Vandette wrote:
> What do you think about fixing getTotalSwapSpaceSze and getFreeSwapSpaceSize to return 0L if either of
> the underlying Metrics used to calculate the result return -1. Of course we only do this if containerMetrics != null.
No, I don't think that would be appropriate. This would result in too
many false positives for JDKs running in a container, say with a CPU
limit, but without a memory limit.
In general, the mode of operation for metrics is to use them if you can
be sure they're present otherwise defer to values of the container
host.
Perhaps we should consider adding some traces when this happens, so
that we at least point *something* out to the user. Even though, it
might be a wrong warning in some cases.
> Failure to read these values, means we have no swap. If we have no swap we also have no free swap. 0 seems
> like an appropriate value to represent this state.
I believe, -1 for certain container metrics can be returned for the
"unlimited" case, too. In that case, returning 0 would be wrong.
> It seems as though some kernels report 0 when kernel swap limit is not enabled while others don’t populate
> the memory status files.
Unfortunately, yes.
Thanks,
Severin
More information about the hotspot-dev
mailing list