mzhaom / gperftools

Fast, multi-threaded malloc() and nifty performance analysis tools
https://code.google.com/p/gperftools/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Enhancement: periodic memory dumps #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes memory is cached infinitely but correctly released when 
application exits. To track such issues it is necessary to dump heap 
profile not only when the application allocates more memory but also when 
it runs idle and is supposed to release memory. Proposed patch is attached.

Original issue reported on code.google.com by mte...@googlemail.com on 3 Mar 2009 at 11:25

Attachments:

GoogleCodeExporter commented 9 years ago
Hmm, it's an interesting idea.  The repeated calls to time() may be a bit 
expensive,
though since it's only incurred when the flag is set, it's probably an ok cost. 
 I'll
suggest it to some of the folks here to see if there's interest.  (Note, by 
default,
I"d set this flag to false, so people would have to ask to turn it on.)

Original comment by csilv...@gmail.com on 3 Mar 2009 at 4:37

GoogleCodeExporter commented 9 years ago
Some folks I talked to came back with another suggestion:
make inuse_interval and allocation_interval 'unsigned': we'd dump when the 
absolute
difference wrt the last dump goes over the threshold amount.  So if the 
application
releases memory while it's idle, eventually this will trigger a dump.  (We'd 
maybe
control this new behavior with a flag.)

Would this address the concerns you were seeing?  It may be a bit cleaner than 
using
time.

Original comment by csilv...@gmail.com on 3 Mar 2009 at 10:54

GoogleCodeExporter commented 9 years ago
I really like the idea of making the variables unsigned, it is cleaner and will 
cover most of the cases. Still there maybe a case when apllication releases 
less 
memory in idle than it allocated under load and the difference doesn not go 
over the 
threshold amount. It would be nice to have an ability to dump memory at certain 
intervals for such extreme case, maybe excluded by default by preprocessor 
definition.

Original comment by mte...@googlemail.com on 4 Mar 2009 at 12:03

GoogleCodeExporter commented 9 years ago
I've made it so you can set the delta amount separately for memory gain as 
memory
loss, which should address your concerns.  I hope to have a new release out 
shortly;
let us know how it works for you!

Original comment by csilv...@gmail.com on 6 Mar 2009 at 5:05

GoogleCodeExporter commented 9 years ago
I've added a flag for negative delta amounts in perftools 1.1, just released.

Original comment by csilv...@gmail.com on 11 Mar 2009 at 9:21