Algorithm currently uses "MemFree" + "Inactive" from /proc/meminfo
"Inactive" may not be a very good indication of how much memory can be readily freed because it contains both:
- Pages mapped with MAP_SHARED|MAP_ANONYMOUS (regardless of whether they're being actively accessed or not. Unclear to me why this is the case...)
- Pages mapped MAP_PRIVATE|MAP_ANONYMOUS that have not been accessed recently
Both of these types of pages probably shouldn't be considered "Available".
"Inactive(file)" would seem more accurate but it's not available in all kernel versions. To keep things simple, maybe just use "Inactive(file)" if available, otherwise fallback to "Inactive".
- is required by
-
YARN-5202
Dynamic Overcommit of Node Resources - POC
-
-
Open
{"report":{"fcp":3706.6999999284744,"ttfb":188.39999997615814,"pageVisibility":"visible","entityId":12947076,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":16,"apdex":0.5,"journeyId":"0ca43acd-ed9c-46bf-a11c-cfd3cfa7e9c8","navigationType":0,"readyForUser":3845.6999999284744,"redirectCount":0,"resourceLoadedEnd":2926.899999976158,"resourceLoadedStart":194.09999990463257,"resourceTiming":[{"duration":734,"initiatorType":"link","name":"https://issues.apache.org/jira/s/b62489a2eaac59d9b8a093c1a51d034f-CDN/xd97tr/820010/13pdxe5/49fa3aa3d35a2cc689cbf274e66cc41a/_/download/contextbatch/css/_super/batch.css","startTime":194.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":194.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":734.2000000476837,"initiatorType":"link","name":"https://issues.apache.org/jira/s/56490edcf9d54e35149505f78cca6a47-CDN/xd97tr/820010/13pdxe5/72cb823bcc50211a60c1ebe830467cae/_/download/contextbatch/css/jira.browse.project,jira.view.issue,project.issue.navigator,atl.general,atl.global,jira.global,jira.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&richediton=true&slack-enabled=true","startTime":194.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":194.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.5,"responseStart":0,"secureConnectionStart":0},{"duration":797.7999999523163,"initiatorType":"script","name":"https://issues.apache.org/jira/s/5263129088916436ab9aeb2417075b3f-CDN/xd97tr/820010/13pdxe5/49fa3aa3d35a2cc689cbf274e66cc41a/_/download/contextbatch/js/_super/batch.js?locale=en-UK","startTime":194.5,"connectEnd":194.5,"connectStart":194.5,"domainLookupEnd":194.5,"domainLookupStart":194.5,"fetchStart":194.5,"redirectEnd":0,"redirectStart":0,"requestStart":194.5,"responseEnd":992.2999999523163,"responseStart":992.2999999523163,"secureConnectionStart":194.5},{"duration":2096.399999976158,"initiatorType":"script","name":"https://issues.apache.org/jira/s/611c208bd094adb71a6f4f3e7f6fff3d-CDN/xd97tr/820010/13pdxe5/72cb823bcc50211a60c1ebe830467cae/_/download/contextbatch/js/jira.browse.project,jira.view.issue,project.issue.navigator,atl.general,atl.global,jira.global,jira.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&slack-enabled=true","startTime":194.69999992847443,"connectEnd":194.69999992847443,"connectStart":194.69999992847443,"domainLookupEnd":194.69999992847443,"domainLookupStart":194.69999992847443,"fetchStart":194.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":194.69999992847443,"responseEnd":2291.0999999046326,"responseStart":2291.0999999046326,"secureConnectionStart":194.69999992847443},{"duration":834.7000000476837,"initiatorType":"script","name":"https://issues.apache.org/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/xd97tr/820010/13pdxe5/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":194.79999995231628,"connectEnd":194.79999995231628,"connectStart":194.79999995231628,"domainLookupEnd":194.79999995231628,"domainLookupStart":194.79999995231628,"fetchStart":194.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":194.79999995231628,"responseEnd":1029.5,"responseStart":1029.5,"secureConnectionStart":194.79999995231628},{"duration":716.9000000953674,"initiatorType":"script","name":"https://issues.apache.org/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/xd97tr/820010/13pdxe5/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":195.09999990463257,"connectEnd":195.09999990463257,"connectStart":195.09999990463257,"domainLookupEnd":195.09999990463257,"domainLookupStart":195.09999990463257,"fetchStart":195.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":195.09999990463257,"responseEnd":912,"responseStart":912,"secureConnectionStart":195.09999990463257},{"duration":733.3000000715256,"initiatorType":"link","name":"https://issues.apache.org/jira/s/981f587853769311cda7c3b845131a06-CDN/xd97tr/820010/13pdxe5/cb5a5495a038c0744457f25821ba9ee8/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":195.19999992847443,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":195.19999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.5,"responseStart":0,"secureConnectionStart":0},{"duration":822.6000000238419,"initiatorType":"script","name":"https://issues.apache.org/jira/rest/api/1.0/shortcuts/820010/5840efff50357da9055d4714dc0713f/shortcuts.js?context=issuenavigation&context=issueaction","startTime":195.39999997615814,"connectEnd":195.39999997615814,"connectStart":195.39999997615814,"domainLookupEnd":195.39999997615814,"domainLookupStart":195.39999997615814,"fetchStart":195.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":195.39999997615814,"responseEnd":1018,"responseStart":1018,"secureConnectionStart":195.39999997615814},{"duration":720.5,"initiatorType":"link","name":"https://issues.apache.org/jira/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/xd97tr/820010/13pdxe5/efa42a25652b26dfd802540c024826b3/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.css?jira.create.linked.issue=true&richediton=true","startTime":208.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":928.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":818.7999999523163,"initiatorType":"script","name":"https://issues.apache.org/jira/s/efa8931cd5ac13ed95c56ca8a1dc1967-CDN/xd97tr/820010/13pdxe5/efa42a25652b26dfd802540c024826b3/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.js?jira.create.linked.issue=true&locale=en-UK&richediton=true","startTime":208.89999997615814,"connectEnd":208.89999997615814,"connectStart":208.89999997615814,"domainLookupEnd":208.89999997615814,"domainLookupStart":208.89999997615814,"fetchStart":208.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":208.89999997615814,"responseEnd":1027.6999999284744,"responseStart":1027.6999999284744,"secureConnectionStart":208.89999997615814},{"duration":2003.5999999046326,"initiatorType":"script","name":"https://issues.apache.org/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/xd97tr/820010/13pdxe5/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":299.5,"connectEnd":299.5,"connectStart":299.5,"domainLookupEnd":299.5,"domainLookupStart":299.5,"fetchStart":299.5,"redirectEnd":0,"redirectStart":0,"requestStart":299.5,"responseEnd":2303.0999999046326,"responseStart":2303.0999999046326,"secureConnectionStart":299.5},{"duration":2627.2000000476837,"initiatorType":"script","name":"https://issues.apache.org/jira/s/d41d8cd98f00b204e9800998ecf8427e-CDN/xd97tr/820010/13pdxe5/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":299.6999999284744,"connectEnd":299.6999999284744,"connectStart":299.6999999284744,"domainLookupEnd":299.6999999284744,"domainLookupStart":299.6999999284744,"fetchStart":299.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":299.6999999284744,"responseEnd":2926.899999976158,"responseStart":2926.899999976158,"secureConnectionStart":299.6999999284744},{"duration":901.8999999761581,"initiatorType":"xmlhttprequest","name":"https://issues.apache.org/jira/rest/webResources/1.0/resources","startTime":1402.5,"connectEnd":1402.5,"connectStart":1402.5,"domainLookupEnd":1402.5,"domainLookupStart":1402.5,"fetchStart":1402.5,"redirectEnd":0,"redirectStart":0,"requestStart":1402.5,"responseEnd":2304.399999976158,"responseStart":2304.399999976158,"secureConnectionStart":1402.5}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":6,"responseStart":189,"responseEnd":298,"domLoading":193,"domInteractive":4069,"domContentLoadedEventStart":4069,"domContentLoadedEventEnd":4155,"domComplete":4732,"loadEventStart":4732,"loadEventEnd":4734,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3930.5},{"name":"bigPipe.sidebar-id.end","time":3931.1999999284744},{"name":"bigPipe.activity-panel-pipe-id.start","time":3931.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":3934.2999999523163},{"name":"activityTabFullyLoaded","time":4176.399999976158}],"measures":[],"correlationId":"53b6de68a23957","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":139,"dbReadsTimeInMs":3,"dbConnsTimeInMs":14,"applicationHash":"ace47f9899e9ee25d7157d59aa17ab06aee30d3d","experiments":[]}}
Patch for trunk.
Also changed getPhysicalMemorySize() to exclude:
Comments welcome on alternative ways to approach these.