You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one will be interesting since free is implemented as just performing cat /proc/meminfo essentially.
I noticed the output of cat /proc/meminfo on my Linux machine is completely different from NuttX. Memory "chunks" are listed one per newline and the output is shown in units of kB. The free outputs between Linux and NuttX are very similar though.
According to man free:
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The in‐
formation is gathered by parsing /proc/meminfo. The displayed columns are:
total Total usable memory (MemTotal and SwapTotal in /proc/meminfo). This includes the physical and swap memory minus a few reserved bits and kernel
binary code.
used Used or unavailable memory (calculated as total - available)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cache Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)
buff/cache
Sum of buffers and cache
available
Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free
fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use
(MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)
So I think solving this issue will involve:
Changing the output of proc/meminfo to match a more standard representation (and which will be easier to parse)
Changing the free command to parse /proc/meminfo directly and then print the tabular version according the man-pages with the desired command-line options.
Activity
linguini1 commentedon Mar 2, 2026
This one will be interesting since
freeis implemented as just performingcat /proc/meminfoessentially.I noticed the output of
cat /proc/meminfoon my Linux machine is completely different from NuttX. Memory "chunks" are listed one per newline and the output is shown in units of kB. Thefreeoutputs between Linux and NuttX are very similar though.According to
man free:So I think solving this issue will involve:
proc/meminfoto match a more standard representation (and which will be easier to parse)freecommand to parse/proc/meminfodirectly and then print the tabular version according the man-pages with the desired command-line options.