mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8194086: Remove deprecated experimental flag UseCGroupMemoryLimitForHeap
Remove the option and the code that checks for it. Reviewed-by: dholmes, lfoltan
This commit is contained in:
parent
1a25bbdf0f
commit
e52d643ff5
2 changed files with 0 additions and 32 deletions
|
@ -509,7 +509,6 @@ static SpecialFlag const special_jvm_flags[] = {
|
|||
{ "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() },
|
||||
|
||||
|
@ -1856,32 +1855,6 @@ void Arguments::set_heap_size() {
|
|||
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))
|
||||
|
|
|
@ -2042,11 +2042,6 @@ public:
|
|||
"MaxRAM * MaxRAMPercentage / 100") \
|
||||
range(0, max_uintx) \
|
||||
\
|
||||
experimental(bool, UseCGroupMemoryLimitForHeap, false, \
|
||||
"Use CGroup memory limit as physical memory limit for heap " \
|
||||
"sizing" \
|
||||
"Deprecated, replaced by container support") \
|
||||
\
|
||||
product(uintx, MaxRAMFraction, 4, \
|
||||
"Maximum fraction (1/n) of real memory used for maximum heap " \
|
||||
"size. " \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue