The value NetXMS returns is correct. Your system does not have 6GB of free memory, it has 1.4GB.
It is using 2.1GB for applications and 4.5GB for Cache. Adding that up means the system is using 6.6GB of RAM, which leaves 1.4GB free (which is shown on the graph, the returned value is not "near zero").
You are confusing free memory with available memory. Memory used for caching is "available", but it is not "free".
Available memory is a different DCI: System.Memory.Physical.Available and it would have returned a value of 5.9GB at that time, which also matches your Task Manager screenshot.
It is using 2.1GB for applications and 4.5GB for Cache. Adding that up means the system is using 6.6GB of RAM, which leaves 1.4GB free (which is shown on the graph, the returned value is not "near zero").
You are confusing free memory with available memory. Memory used for caching is "available", but it is not "free".
Available memory is a different DCI: System.Memory.Physical.Available and it would have returned a value of 5.9GB at that time, which also matches your Task Manager screenshot.