Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: tools/tcmalloc/print-live-objects.py

Issue 10544118: Sort memory leaks by size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tcmalloc/print-live-objects.py
diff --git a/tools/tcmalloc/print-live-objects.py b/tools/tcmalloc/print-live-objects.py
index 9886fd1924e141e603ef91ffb3e79772fe219189..dfed9c60999c01a8c9347deb5c7846afb192d8b0 100755
--- a/tools/tcmalloc/print-live-objects.py
+++ b/tools/tcmalloc/print-live-objects.py
@@ -80,7 +80,7 @@ def Main(argv):
if not traces:
print "No leaks found!"
- for trace in traces:
+ for trace in sorted(traces, key=lambda x: -x["size"]):
print "Leak of %d bytes at address %s" % (trace["size"], trace["address"])
for frame in trace["frames"]:
print " %s (%s)" % (frame["name"], frame["location"])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698