How to determine free memory in Mono / C # in Linux (no external DLL)

I can read available memory using extern c function to read sys / sysinfo. Anyway, I want to do it with a mono class (can't find a corresponding function in Mono.Unix.Native.Syscall) and I can't use PerformanceCounter with "Available MBytes" as it is not implemented in mono. ..

Ubuntu / Mono 4.1.0

Any idea how to read free RAM in C # / Mono / Linux?

+3


source to share


2 answers


I decided to use sysinfo in the end. Polling every X seconds in a separate waiting thread.



And nice -15 is always nice to use .. :)

0


source


Perhaps you can use a shell command from Mono with something like free -m



+1


source







All Articles