|
From: Patrick R. <pr...@gm...> - 2006-03-14 23:37:34
|
Hi, Does valgrind provide a way to print the max used size of the stack, i.e., how big the stack utilization grew for a program run (at least for the main stack if on a multithreaded application)? This is useful to know if the stack was sized appropriately. Patrick |
|
From: Nicholas N. <nj...@cs...> - 2006-03-14 23:56:33
|
On Tue, 14 Mar 2006, Patrick Rabau wrote: > Does valgrind provide a way to print the max used size of the stack, > i.e., how big the stack utilization grew for a program run (at least > for the main stack if on a multithreaded application)? This is useful > to know if the stack was sized appropriately. Massif (use --tool=massif) will give you an idea about this. Nick |
|
From: Patrick R. <pr...@gm...> - 2006-03-18 17:51:44
|
On 3/14/06, Nicholas Nethercote <nj...@cs...> wrote: > On Tue, 14 Mar 2006, Patrick Rabau wrote: > > > Does valgrind provide a way to print the max used size of the stack, > > i.e., how big the stack utilization grew for a program run (at least > > for the main stack if on a multithreaded application)? This is useful > > to know if the stack was sized appropriately. > > Massif (use --tool=3Dmassif) will give you an idea about this. > > Nick Massif seems a very useful tool, but it does not really tell the max size of the stack. =3D=3D14478=3D=3D Total spacetime: 46,417,390 ms.B =3D=3D14478=3D=3D heap: 8.5% =3D=3D14478=3D=3D heap admin: 0.0% =3D=3D14478=3D=3D stack(s): 91.3% For example, from the data above, I have no way to know how big the stack grew. Or is there a way? Or if the program does no memory allocation, the stack always shows 0% independently of its size: =3D=3D14592=3D=3D Total spacetime: 0 ms.B =3D=3D14592=3D=3D heap: (n/a) =3D=3D14592=3D=3D heap admin: (n/a) =3D=3D14592=3D=3D stack(s): 0% A possible future enhancement to massif (assuming it tracks that information) would be an option to print out the max size of the stack, and the max size of the heap as well? Patrick |
|
From: Nicholas N. <nj...@cs...> - 2006-03-21 03:06:19
|
On Sat, 18 Mar 2006, Patrick Rabau wrote: > Massif seems a very useful tool, but it does not really tell the max > size of the stack. > > ==14478== Total spacetime: 46,417,390 ms.B > ==14478== heap: 8.5% > ==14478== heap admin: 0.0% > ==14478== stack(s): 91.3% > > For example, from the data above, I have no way to know how big the > stack grew. Or is there a way? The graph will show you. It might not, however, if the stack size is not big enough -- it only shows the top 20 allocation points. > A possible future enhancement to massif (assuming it tracks that > information) would be an option to print out the max size of the > stack, and the max size of the heap as well? Yes, that has been suggested before... Nick |