Wrote a simple test:

#include <iostream>
#include <boost/thread.hpp>

using namespace std;

void myThreadRun() {
    cout << "Thread id: " << boost::this_thread::get_id() << "\n";
}

int main() {
    for (int i = 0; i < 10000; i++) {
        boost::thread t(myThreadRun);

        t.join();
    }

    return 0;
}

on which Valgrind Massif shows the following graph:

Valgrind Massif profiling result for the above example

(The stack profiling was enabled. Platform: Linux Ubuntu x86).

This program does not actually seem to have memory leaks: the memory usage is stable.

I wonder: is it a problem of Valgrind or boost::thread? Or maybe I misinterpret something?

How would you explain that?

Edit
Report