8198833: TestMemoryAwareness Docker container fails with too small maximum heap
Reviewed-by: bobv, dholmes
--- a/src/hotspot/os/linux/os_linux.cpp Fri Mar 02 21:00:12 2018 +0100
+++ b/src/hotspot/os/linux/os_linux.cpp Fri Mar 02 11:43:19 2018 +0100
@@ -203,7 +203,7 @@
jlong mem_limit;
if ((mem_limit = OSContainer::memory_limit_in_bytes()) > 0) {
log_trace(os)("total container memory: " JLONG_FORMAT, mem_limit);
- return phys_mem;
+ return mem_limit;
}
log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", using host value",
mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit);