function gatherMemory() {
    let mgr;
    try {
      mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
            getService(Ci.nsIMemoryReporterManager);
    } catch (e) {
      // OK to skip memory reporters in xpcshell
      return;
    }

    let e = mgr.enumerateReporters();
    while (e.hasMoreElements()) {
      let mr = e.getNext().QueryInterface(Ci.nsIMemoryReporter);
      let id = MEM_HISTOGRAMS[mr.path];
      if (!id) {
        continue;
      }

      // Reading mr.amount might throw an exception.  If so, just ignore that
      // memory reporter; we're not getting useful data out of it.
      try {
        this.handleMemoryReport(id, mr.path, mr.units, mr.amount);
      }
      catch (e) {
      }
    }
  }
/**
   * Pull values from about:memory into corresponding histograms
   */
Pull values from about:memory into corresponding histograms
Pull values from about : memory into corresponding histograms
function gatherMemory() {
    let mgr;
    try {
      mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
            getService(Ci.nsIMemoryReporterManager);
    } catch (e) {
      return;
    }
    let e = mgr.enumerateReporters();
    while (e.hasMoreElements()) {
      let mr = e.getNext().QueryInterface(Ci.nsIMemoryReporter);
      let id = MEM_HISTOGRAMS[mr.path];
      if (!id) {
        continue;
      }
      try {
        this.handleMemoryReport(id, mr.path, mr.units, mr.amount);
      }
      catch (e) {
      }
    }
  }
function gatherMemory ( ) { let mgr ; try { mgr = Cc [ "@mozilla.org/memory-reporter-manager;1" ] . getService ( Ci . nsIMemoryReporterManager ) ; } catch ( e ) { return ; } let e = mgr . enumerateReporters ( ) ; while ( e . hasMoreElements ( ) ) { let mr = e . getNext ( ) . QueryInterface ( Ci . nsIMemoryReporter ) ; let id = MEM_HISTOGRAMS [ mr . path ] ; if ( ! id ) { continue ; } try { this . handleMemoryReport ( id , mr . path , mr . units , mr . amount ) ; } catch ( e ) { } } }
Pull values from about:memory into corresponding histograms
Pull values from about : memory into corresponding histograms
// OK to skip memory reporters in xpcshell // Reading mr.amount might throw an exception.  If so, just ignore that // memory reporter; we're not getting useful data out of it.