I have a program that, when queried on initialisation, is immediately using > 2 GB of RAM. Basically the code is like this:
#include <blah>
int main() {
cout << get_mem_usage() << endl;
//Lots of things happen, but no significant memory usage
return 0;
}
Output: [2013-02-15 18:38:05.865283] 2147.71 Mb
I am, however, linking to a lot of different shared object files: I checked ldd and I am linking to 58 libraries, with a combined .so size of 66 MB.
I'm pretty sure that the get_mem_usage program is returning the correct values: these agree with top and massif output.
I should also mention that I am linking against the ROOT framework for High Energy Physics analysis.
I am using Linux x86_64, and the get_mem_usage() function is homegrown.
I would like to reduce the memory usage of the program, if at all possible.