summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@xander>2010-12-18 00:46:08 +0200
committerLars Wirzenius <liw@xander>2010-12-18 00:46:08 +0200
commit6c8bacfe91a842fd01492bf37b3f3a5bf7f6ec53 (patch)
treeeb20fcca024af96ca8b0345936145277ed2192eb
parente1edb3edcead3886cf4f456d522d154faa2b20a6 (diff)
downloadobnam-6c8bacfe91a842fd01492bf37b3f3a5bf7f6ec53.tar.gz
Add meliae dumps to dump_memory_profile.
-rw-r--r--obnamlib/plugins/backup_plugin.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py
index 99447249..69ea2351 100644
--- a/obnamlib/plugins/backup_plugin.py
+++ b/obnamlib/plugins/backup_plugin.py
@@ -76,7 +76,7 @@ class BackupPlugin(obnamlib.ObnamPlugin):
self.exclude_pats = [re.compile(x) for x in self.app.config['exclude']]
last_checkpoint = 0
- self.meliae_counter = 0
+ self.memory_dump_counter = 0
interval = self.app.config['checkpoint']
if roots:
@@ -134,6 +134,12 @@ class BackupPlugin(obnamlib.ObnamPlugin):
h = hpy()
logging.debug('memory profile:\n%s' % h.heap())
+ from meliae import scanner
+ filename = 'obnam-%d.meliae' % self.memory_dump_counter
+ scanner.dump_all_objects(filename)
+
+ self.memory_dump_counter += 1
+
def find_files(self, root):
'''Find all files and directories that need to be backed up.