c++ - How to get memory information on Linux system? -
Using total memory, memory, and free memory from C ++ code on Linux system?
Run your program through valgrind
. For a program called foo
, for example:
valgrind foo
This program will keep in the harness that keeps Track the usage of memory and print out that information after the program is over.
If you do not have valgrind
installed for any reason, then you should be able to find it in your distributions package repository
Comments
Post a Comment