Program:
I created a C++ calculation program for high volume of data, which could be run on 1 or more threads. (via config file)
The program environment is the following: C++, OpenMp, Redhat-x64, malloc/free
Results on Linux:
Results on Windows:
Question:
Why does the memory consumption grows when using more threads on Linux?
A fair guess is that delete in Linux will cache released memory for future new requests, just as it does on Windows, but Linux has a cache per thread whereas Windows has a cache per process.
(More accurately, it would be the C++ runtime library that determines how such a cache works).
Use /proc/<PID>/maps, or better pmap(1), to figure out where the pages go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With