I've simple program e.g. in C++
#include <iostream>
int main()
{
int a = 1000;
std::cout << a << std::endl;
return 0;
}
and i'm trying to calculate memory usage with GNU time. But in "time" output (with my format, it doesn't matter) maximum size of process in memory is calculated with libc.so which has printf function (call to std::cout) and is equal to 3.5 Mb.
Is there a way to calculate process memory without loaded shared libs?
UPD I can't do it while process, which memory i wanna measure, runs, for several reasons. I'm asking if there's a way to do it with outer wrapper tool (like time
is)