From ece7db1aeb25fdf364d1b0e566a2dfebd025d760 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Wed, 27 Sep 2017 15:21:30 -0700 Subject: [PATCH] fix: dump_rpy_heap before calling objgraph just in case objgraph pollutes its output Closes #1028 --- autopush/memusage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autopush/memusage.py b/autopush/memusage.py index 0c5dd60c..00da5818 100644 --- a/autopush/memusage.py +++ b/autopush/memusage.py @@ -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()