wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Utility/GetMemFree

Version 4 (modified by Don Wilson, 13 years ago) ( diff )

--

GetMemFree

Get the amount of free RAM memory available

int GetMemFree(void);

Parameters

Function does not accept any parameters.

Return Value

This function returns the number of unused K bytes of RAM available in the system. This is the total free memory available. A request for a smaller amount of memory could still fail if there is not a large enough contiguous block of memory available.

Remarks

The function reads /proc/meminfo to obtain the result. It can be useful when testing an application to use the function to display free memory periodically and run the application for several hours/days to make sure the application is not allocating memory and never releasing it.

Examples

string str = StrFmt("Free memory %d K bytes", GetMemFree());
DisplayText(0, 0, str);

See Also

Note: See TracWiki for help on using the wiki.