Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: dump_rpy_heap before calling objgraph
Browse files Browse the repository at this point in the history
just in case objgraph pollutes its output

Closes #1028
  • Loading branch information
pjenvey committed Sep 29, 2017
1 parent 0016d96 commit ece7db1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autopush/memusage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ def trap_err(func, *args, **kwargs):
buf = StringIO()
rusage = trap_err(resource.getrusage, resource.RUSAGE_SELF)
buf.writelines([repr(rusage), '\n\n'])
trap_err(objgraph.show_most_common_types, limit=0, file=buf)
buf.write('\n\n')
trap_err(pmap_extended, buf)
# dump rpython's heap before objgraph potentially pollutes the
# heap with its heavy workload
trap_err(dump_rpy_heap, buf)
trap_err(get_stats_asmmemmgr, buf)
buf.write('\n\n')
trap_err(objgraph.show_most_common_types, limit=0, file=buf)
return buf.getvalue()


Expand Down

0 comments on commit ece7db1

Please sign in to comment.