c++ - How to get a process' memory and time usage? -


i'm trying process's memory , time usage,and here [my code] memory reported such simple app consuming 8500kb. has i've done reported wrong memory usage or there other reasons?

#include "trace.h" #include "include.h" #include "trace.cpp" using namespace std; int main(int argc, const char * argv[]) {     trace t;     t.setlimitinfo();     t.createprocess();     t.waitforchild();       cout<<"time usage: "<<t.gettime()<<"ms memory usage: "<<t.getmemory()<<"kb"<<endl;     // insert code here... //    std::cout << "hello, world!\n";     return 0; } 

i use valgrind --tool=massif check memory usage.

check the doc


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -