I’m trying to make a c++ program print out its own memory footprint.
Whats a good way to print out the KB of memory a c++ program is using at the current time?
I would need it for Linux and windows…so something platform independent….
Thank you,
MS
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I dont think there is a mutli-platform way of doing this.
But you could use macros to do it like:
heres a link for the windows method:
How to get memory usage under Windows in C++
and one for a linux method:
How to get memory usage at run time in c++?