cynthia / gperftools

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

Need an environment setting to control whether or not to allow child processes to be profiled when using the heap profiler. #378

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Run the heap profiler against an executable (using LD_PRELOAD method) that 
spawns child processes. For example, executing a script.

What is the expected output? What do you see instead?
I would expect that heap profiles would be dumped for the parent process only 
since child processes are generally short lived. Also, if there is a 
possibility that there may be hundreds of child processes then this can 
generate a significant number of heap profiles.

Please use labels and text to provide additional information.
I suppose having the child processes inherit the heap profiling from their 
parent is expected. However, I suspect that it shouldn't be the default. 
Instead we should have the ability to turn on that behaviour. I am proposing 
the addition of an environment variable to control this:

HEAP_PROFILE_INCLUDE_CHILD_PROCESSES

With the default value set to false.

Original issue reported on code.google.com by chapp...@gmail.com on 4 Nov 2011 at 3:10

GoogleCodeExporter commented 9 years ago
How much trouble is it causing you to have the child processes profiled?  It 
can generate a number of heap profiles, to be sure, but they're small and have 
a well-patterned name that's easy to ignore or delete if you want to.

I'd rather not add more environment variables to perftools (which already has 
too many!) if we can help it.

Original comment by csilv...@gmail.com on 4 Nov 2011 at 7:24

GoogleCodeExporter commented 9 years ago
The number of child process heap files can be in the order of thousands at 
times. They are the result of "reload" events that spawn a few child processes 
for every reload. In some cases we setup automated testing environments that 
can run for several days generating many thousands of reloads. I realize that 
the more dials and knobs that get added tend to make it a bit more of a 
maintenance hassle but this one would be really handy.

Original comment by chapp...@gmail.com on 4 Nov 2011 at 7:47

GoogleCodeExporter commented 9 years ago
But again, is this a problem?  How bad is it to have thousands of profile files 
hanging around?  What is the actual pain point you're seeing here?

Original comment by csilv...@gmail.com on 4 Nov 2011 at 8:56

GoogleCodeExporter commented 9 years ago
Ping.  If I don't hear anything in a week or so I'll close the bug.

Original comment by csilv...@gmail.com on 25 Jan 2012 at 11:53

GoogleCodeExporter commented 9 years ago
You can close this one. If it rears its head again I'll take a closer look
at it.

Original comment by chapp...@gmail.com on 26 Jan 2012 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by chapp...@gmail.com on 3 Mar 2012 at 7:29