microsoft / onefuzz

A self-hosted Fuzzing-As-A-Service platform
MIT License
2.82k stars 199 forks source link

Investigate / and fix the way that we calculate available memory in our tasks #3585

Open kananb opened 9 months ago

kananb commented 9 months ago

I have a suspicion that we aren't counting swap space on Linux nodes when calculating available memory.

I think it's worth checking both the Windows and Linux memory calculations to ensure that they are counting all available memory instead of just physical memory.

Starting the Linux Investigation

For linux, we're using /proc/meminfo to learn about memory availability. But, based on this page about that file we might want to consider swap space and virtual memory rather than just "general memory".

Starting the Windows Investigation

It's not entirely clear to me based on the Win32 docs on the PERFORMANCE_INFORMATION struct that the value we're calculating with accounts for all free memory (swap and virtual included). Another source might be needed (or just consultation with someone who knows more of the terminology).

AB#168356