How to get memory usage

I want to make sure my resources exceed the limited memory usage.
and I walk around the world and check out real time memory usage.
I think stat memory command is useful, but I don’t know how to check total used memory.
Can anyone tell me a tip that checks the memory usage?

I’m also interested in this!

try stat memoryPlatform