Re: check if the memory is low, from Windows to Unix



On Jan 31, 7:40 am, kevin.he...@xxxxxxxxx wrote:
Hi all,

How to implement such function for Linux/Unix?

MEMORYSTATUS stat;
GlobalMemoryStatus(&stat);
result = ((float)stat.dwAvailPageFile / stat.dwTotalPageFile) < 0.1;


As others have pointed out, this is OT for the group, but the above
does not do what you appear to want, even under Windows. The page
file size is dynamic (unless it's been explicitly fixed), so the ratio
you're computing is basically meaningless.

.