зеркало из https://github.com/mozilla/gecko-dev.git
Bug 832067 - Discard cached statements in healthreporter. r=gps
This commit is contained in:
Родитель
6ae127581e
Коммит
5b8a3228cd
|
@ -307,6 +307,9 @@ HealthReporter.prototype = Object.freeze({
|
||||||
this._log.info("HealthReporter started.");
|
this._log.info("HealthReporter started.");
|
||||||
this._initialized = true;
|
this._initialized = true;
|
||||||
Services.obs.addObserver(this, "idle-daily", false);
|
Services.obs.addObserver(this, "idle-daily", false);
|
||||||
|
|
||||||
|
// Clean up caches and reduce memory usage.
|
||||||
|
this._storage.compact();
|
||||||
this._initializedDeferred.resolve(this);
|
this._initializedDeferred.resolve(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -695,6 +698,7 @@ HealthReporter.prototype = Object.freeze({
|
||||||
o.errors = errors;
|
o.errors = errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._storage.compact();
|
||||||
throw new Task.Result(JSON.stringify(o));
|
throw new Task.Result(JSON.stringify(o));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1204,6 +1204,21 @@ MetricsStorageSqliteBackend.prototype = Object.freeze({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reduce memory usage as much as possible.
|
||||||
|
*
|
||||||
|
* This returns a promise that will be resolved on completion.
|
||||||
|
*
|
||||||
|
* @return Promise<>
|
||||||
|
*/
|
||||||
|
compact: function () {
|
||||||
|
let self = this;
|
||||||
|
return this.enqueueOperation(function doCompact() {
|
||||||
|
self._connection.discardCachedStatements();
|
||||||
|
return self._connection.shrinkMemory();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure a field ID matches a specified type.
|
* Ensure a field ID matches a specified type.
|
||||||
*
|
*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче