From 8c6a9bfbf08009801b545f9604ddf719c11b991b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 17 Jul 2013 18:03:00 -0400 Subject: [PATCH] Add some debugging for a memory usage issue during file syncing --- chrome/content/zotero/xpcom/storage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 95e4e6e222..28083eb3eb 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -656,6 +656,11 @@ Zotero.Sync.Storage = new function () { this.checkForUpdatedFiles = function (itemModTimes, libraryID) { var msg = "Checking for locally changed attachment files"; + var memmgr = Components.classes["@mozilla.org/memory-reporter-manager;1"] + .getService(Components.interfaces.nsIMemoryReporterManager); + memmgr.init(); + Zotero.debug("Memory usage: " + memmgr.resident); + if (typeof libraryID != 'undefined') { msg += " in library " + libraryID; if (itemModTimes) { @@ -740,8 +745,10 @@ Zotero.Sync.Storage = new function () { var updatedStates = {}; var items = Zotero.Items.get(itemIDs); for each(var item in items) { + Zotero.debug("Memory usage: " + memmgr.resident); + var lk = libraryID + "/" + item.key; - //Zotero.debug("Checking attachment file for item " + lk); + Zotero.debug("Checking attachment file for item " + lk); var file = item.getFile(attachmentData[item.id]); if (!file) { Zotero.debug("Marking attachment " + lk + " as missing");