7 #include <sys/sysinfo.h>
18 const FwSizeType MAX_MEASURABLE_RAM_UNITS = std::numeric_limits<FwSizeType>::max() / info.mem_unit;
19 if ((MAX_MEASURABLE_RAM_UNITS < info.totalram) || (MAX_MEASURABLE_RAM_UNITS < info.freeram)) {
20 memory_usage.
total = 1;
21 memory_usage.
used = 1;
25 memory_usage.
total = info.totalram * info.mem_unit;
26 memory_usage.
used = info.freeram * info.mem_unit;
31 return &this->m_handle;
PlatformSizeType FwSizeType
MemoryHandle * getHandle() override
returns the raw console handle
Status _getUsage(Os::Memory::Usage &memory_usage) override
get system memory usage
Memory variable handle parent.
Status
Generic OK/ERROR status.
@ OP_OK
Operation succeeded.
Generic used/total struct.
FwSizeType total
Total amount.
FwSizeType used
Used amount.