Open markwolff opened 4 years ago
Did some investigation and the os.freemem()
does return the equivalent value with available memory
.
Available physical memory = Standby + Free Reference: link1, link2
os.freemem returns memory_status.ullAvailPhys = Standby + Free + Zero
What is ullAvailPhys: The amount of physical memory currently available, in bytes. This is the amount of physical memory that can be immediately reused without having to write its contents to disk first. It is the sum of the size of the standby, free, and zero lists.
The above analysis is for Windows.
Adding more context to the issue :
https://github.com/microsoft/ApplicationInsights-node.js/blob/439bd18f74f167d903f40b2e63f872f934b8d089/AutoCollection/Performance.ts#L230
AVAILABLE_MEMORY
metric is calculated withos.fremem()
, which is not equivalent to available memory. An investigation should be done on how to properly measure and track this metric