ApplicationInsights-node.js icon indicating copy to clipboard operation
ApplicationInsights-node.js copied to clipboard

[PerfCounters] Available memory metric does not match system values

Open markwolff opened this issue 5 years ago • 2 comments

https://github.com/microsoft/ApplicationInsights-node.js/blob/439bd18f74f167d903f40b2e63f872f934b8d089/AutoCollection/Performance.ts#L230

AVAILABLE_MEMORY metric is calculated with os.fremem(), which is not equivalent to available memory. An investigation should be done on how to properly measure and track this metric

markwolff avatar Sep 02 '20 18:09 markwolff

Did some investigation and the os.freemem() does return the equivalent value with available memory.

Available physical memory = Standby + Free Reference: link1, link2 image

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.

xiao-lix avatar Jun 15 '21 00:06 xiao-lix

The above analysis is for Windows.

Adding more context to the issue : image

xiao-lix avatar Jun 16 '21 17:06 xiao-lix