-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Port to Release/3.1 - Fix available memory extraction on Linux #26938
Port to Release/3.1 - Fix available memory extraction on Linux #26938
Conversation
Got it working on OSX, but there are some build errors on Linux, @janvorli could you help me? |
@agoretsky the issue is that you have accidentally added the GetLogicalProcessorCacheSizeFromOS function to gcenv.os.cpp. That was not part of my change. |
* Fix available memory extraction on Linux The GlobalMemoryStatusEx in PAL is returning number of free physical pages in the ullAvailPhys member. But there are additional pages that are allocated as buffers and caches that get released when there is a memory pressure and thus they are effectively available too. This change extracts the available memory on Linux from the /proc/meminfo MemAvailable row, which is reported by the kernel as the most precise amount of available memory.
Btw, if @MeiChin-Tsai supports porting this fix, I'd still like to give it a bit more time to bake in before merging this port. |
@agoretsky @janvorli does this need to be included with |
@wtgodbe thank you for the heads up, I don't want to rush this. We need to do some more GC perf measurements before porting it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
@agoretsky Can you articulate the scenario that drive the need? Or the risk of fix? |
@MeiChin-Tsai here is the original issue where the details were discussed: |
Approved |
I also endorse this change. |
This can be merged tomorrow, that's when branches open for preview2 |
Port #26764 to 3.1 Release
Close #26924