< prev index next >
src/hotspot/share/runtime/arguments.cpp
Print this page
*** 507,517 ****
{ "UseMembar", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
{ "FastTLABRefill", JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
{ "SafepointSpinBeforeYield", JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
{ "DeferThrSuspendLoopCount", JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
{ "DeferPollingPageLoopCount", JDK_Version::jdk(10), JDK_Version::jdk(11), JDK_Version::jdk(12) },
- { "UseCGroupMemoryLimitForHeap", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::jdk(11) },
{ "IgnoreUnverifiableClassesDuringDump", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
{ "CheckEndorsedAndExtDirs", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
--- 507,516 ----
*** 1854,1889 ****
void Arguments::set_heap_size() {
julong phys_mem =
FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
: (julong)MaxRAM;
- // Experimental support for CGroup memory limits
- if (UseCGroupMemoryLimitForHeap) {
- // This is a rough indicator that a CGroup limit may be in force
- // for this process
- const char* lim_file = "/sys/fs/cgroup/memory/memory.limit_in_bytes";
- FILE *fp = fopen(lim_file, "r");
- if (fp != NULL) {
- julong cgroup_max = 0;
- int ret = fscanf(fp, JULONG_FORMAT, &cgroup_max);
- if (ret == 1 && cgroup_max > 0) {
- // If unlimited, cgroup_max will be a very large, but unspecified
- // value, so use initial phys_mem as a limit
- log_info(gc, heap)("Setting phys_mem to the min of cgroup limit ("
- JULONG_FORMAT "MB) and initial phys_mem ("
- JULONG_FORMAT "MB)", cgroup_max/M, phys_mem/M);
- phys_mem = MIN2(cgroup_max, phys_mem);
- } else {
- warning("Unable to read/parse cgroup memory limit from %s: %s",
- lim_file, errno != 0 ? strerror(errno) : "unknown error");
- }
- fclose(fp);
- } else {
- warning("Unable to open cgroup memory limit file %s (%s)", lim_file, strerror(errno));
- }
- }
-
// Convert deprecated flags
if (FLAG_IS_DEFAULT(MaxRAMPercentage) &&
!FLAG_IS_DEFAULT(MaxRAMFraction))
MaxRAMPercentage = 100.0 / MaxRAMFraction;
--- 1853,1862 ----
< prev index next >