Page 1 of 1

Free Ram

Posted: 08 Mar 2014 04:27
by Ankit
Hi

I want to know free ram available and i am using this method:

Execute Command: cat /proc/meminfo
Script: mem=split(stdout, "kB");memfree=getElement(mem, 1);memcached=getElement(mem, 3);memfree=substring(memfree, indexOf(memfree, ":")+1, length(memfree));memcached=substring(memcached, indexOf(memcached, ":")+1, length(memcached));global_free_ram="{(memfree+memcached)/1024,numberformat,0}";



But i find that this is inaccurate method and it dont show accurate result and it also hangs sometime.
So please can anyone suggest an alternative.

Re: Free Ram

Posted: 08 Mar 2014 10:10
by Martin
Hi,

If the flow hangs in the Execute Command, you could switch to an action Init Variable Text File: /proc/meminfo since it does not fork a new process and requires less resources.
I'm not aware of a method that's more accurate to read memory information. You could try Execute Command: free as an alternative way to read some memory information.

Regards,
Martin