I'm good with Linux, but can't figure this one out.
I have a Rocket M5 XW with Joe's alpha code in it. It's reporting free memory as 39572 KB.
If I run free -m from its command line, I get:
I know Linux can take advantage of buffered and cached RAM in addtion to free RAM, but I can't make the numbers come out right.
How does OpenWRT calculate free RAM space?
Thanks.
Orv W6BI
I have a Rocket M5 XW with Joe's alpha code in it. It's reporting free memory as 39572 KB.
If I run free -m from its command line, I get:
root@WD6EBY-VC-SimiEast-5G:~# free -m total used free shared buff/cache available Mem: 60436 18520 27140 1088 14776 22532 Swap: 0 0 0
I know Linux can take advantage of buffered and cached RAM in addtion to free RAM, but I can't make the numbers come out right.
How does OpenWRT calculate free RAM space?
Thanks.
Orv W6BI
I think it would be more informative to change this to "Available Memory". This is the value in /proc/meminfo, "MemAvailable". This is the best (kernel) estimate of the memory that is available, to start a program. When there's not enough RAM to start a program, the kernel has to select something to kill, Out-of_Memory condition. I understand MemAvailable includes more factors in the calculation than (free + buffers), thus more accurate.
Joe
I'd vote for that. Thanks, Joe.
Orv
Available Memory: removes the "low water mark" amount of RAM from the calculation, or a threshold defined where swapping would start occurring. The value of Available Memory will actually show at time to be less than free memory.
AREDN Free memory on status page: (free + cache/buffer). But cache/buffer includes things that can not be freed up, e.g. /tmp filesystem.
I'd call Available memory the conservative number, and the (free + cache/buffer), the liberal number. Both are wrong and the real answer is somewhere in the middle :) I think an improved value would be (free + cache/buffer - /tmp consumed).
Joe AE6XE
Thanks, Joe
Orv W6BI