casseopea2 / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Profile should show values in kB instead of 0.0 #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When my memory profile has quite low total (like 0.5MB) many nodes in the
report look like this:
0.0 (0.0%)
of 0.0 (26.8%)

0.0 shouldn't be displayed. If value is too low in MB it should be
displayed in kB. And further if it's too small in kB it should be displayed
in bytes.

Report will make more sense in the case of low total memory.

Original issue reported on code.google.com by visa_des...@yahoo.com on 17 Jan 2009 at 10:12

GoogleCodeExporter commented 9 years ago
I want to add that this is very useful when hunting down small memory leaks.
So small values shouldn't be neglected.

Original comment by visa_des...@yahoo.com on 17 Jan 2009 at 10:12

GoogleCodeExporter commented 9 years ago
You can get this effect using the --show_bytes flag to pprof.  It's not ideal to
require user interaction, but I think the need for this is small enough that 
it's not
worth the effort of reworking the code to support that.

(The reworking isn't hard, per se, but it's not trivial either, and it's in a 
large
number of places that would need to be tested.  The hardest part is figuring out
whether to use MB or bytes for code that currently does "showing 0.0MB of 
1011", that
is, where we have to pick the same unit for two numbers, one of which might be 
very
large while the other is very small.)

Given the cost/benefit, and that there's an existing solution, I'll close the 
bug. 
If anyone would like to work on it anyway, the place to focus is on Unparse() 
and
Units() in src/pprof.

Original comment by csilv...@gmail.com on 6 Mar 2009 at 8:39