From 072680e894d731379e032d0feb6f736d4e477fc7 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 21 Apr 2011 20:31:44 -0700 Subject: [PATCH] "profile" command in BPD for memory debugging --- beetsplug/bpd/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py index 745781900..8e1d9599f 100644 --- a/beetsplug/bpd/__init__.py +++ b/beetsplug/bpd/__init__.py @@ -550,6 +550,12 @@ class BaseServer(object): index = self._id_to_index(track_id) return self.cmd_seek(conn, index, pos) + def cmd_profile(self, conn): + """Memory profiling for debugging.""" + from guppy import hpy + heap = hpy().heap() + print heap + class Connection(object): """A connection between a client and the server. Handles input and output from and to the client.