This isn't boost::threads, it happens with just plain pthreads too. I grabbed the sample program from here (Pthread Creation and Termination), upped the thread count to 1000 and compiled as plain C, and I see the same behavior when processing it with massif. So either it's something in pthreads or something valgrind/massif is doing.
EDIT: used program (Pthread Joining) as well. See second graph.
Creation and Termination:
KB
547.6^ #
| @@@#
| @@@@@@@#
| @@@@@@@@@@#
| @@@@@@@@@@@@@#
| ::::@@@@@@@@@@@@@#
| ::::: ::@@@@@@@@@@@@@#
| @@@::::: ::@@@@@@@@@@@@@#
| @@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@@@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| ::@@@@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@::@ @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@ @::@ @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| @@@@@@ @ @::@ @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| :::::@@@ @@ @ @::@ @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
| :@@: :: @@@ @@ @ @::@ @@@@@ @@ @@ @@ @@@@@@@@@@::::: ::@@@@@@@@@@@@@#
0 +----------------------------------------------------------------------->Mi
0 13.22
Pthread joining, minus the math busy work:
KB
548.8^ #
| @@#::
| :::@@#::
| ::::::@@#:::
| ::::: :::@@#:::::
| @@@@::::: :::@@#:::::
| @@@@@ ::::: :::@@#:::::::
| :@@:@@@@@ ::::: :::@@#:::::::@
| @@@:@ :@@@@@ ::::: :::@@#:::::::@
| :::@ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@@:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @:::@@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| ::@@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| ::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| :@@::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@@:@ ::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@@@@ :@ ::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@@:@@@@@ :@ ::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
| @@@@ :@@@@@ :@ ::@: @@:: @@:@ @:: @ @:@ :@@@@@ ::::: :::@@#:::::::@::
0 +----------------------------------------------------------------------->Mi
0 19.14
It looks like joining should eventually bring the stack size back down, even under valgrind.