mpasternacki/sleeper_agent — pull request #1 by matthewstory (2014-10-29 03:41:34+00:00)
Title: Add memory debugging to sleeper_agent

This pull request adds a `--memory` flag to `sleeper_agent_activate`, which prints out a memory report, in addition to a trace. This is useful in debugging long-lived processes which bloat in memory over time (like celery jobs).

The memory report has one line per type and gives counts and aggregate resident memory usage on a per-type basis:

### Memory Usage
616.8 KB 481 objects
136.0 KB 154 objects
118.1 KB 1008 objects
79.9 KB 1023 objects
38.6 KB 174 objects
38.5 KB 548 objects
37.4 KB 495 objects
33.3 KB 388 objects
28.0 KB 108 objects
26.1 KB 371 objects
14.1 KB 16 objects
13.2 KB 188 objects
11.8 KB 168 objects