Bug 1395509 - Remove existing malloc accounting for externally allocated memory r=sfink?
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 20 May 2019 17:27:02 +0000
changeset 474685 441a4c70ac221317eaf998f43dc8b2cdcb06cd2b
parent 474682 b74e5737da64a7af28ab4f81f996950917aa71c5
child 474686 4166b94f0df55a8080998642b8c2b958308c91ff
push id113168
push userrmaries@mozilla.com
push dateTue, 21 May 2019 16:39:23 +0000
treeherdermozilla-inbound@3c0f78074b72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1395509
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1395509 - Remove existing malloc accounting for externally allocated memory r=sfink? Since we now have precise memory accounting for externally allocated memory associated with GC things we should be able to remove use of the existing malloc counter here. This should help with cases where we trigger too many GCs because we think there is more memory associated than there really is. Differential Revision: https://phabricator.services.mozilla.com/D31806
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1156,17 +1156,16 @@ JS_PUBLIC_API void JS_freeop(JSFreeOp* f
 JS_PUBLIC_API void JS::AddAssociatedMemory(JSObject* obj, size_t nbytes,
                                            JS::MemoryUse use) {
   MOZ_ASSERT(obj);
   if (!nbytes) {
     return;
   }
 
   Zone* zone = obj->zone();
-  zone->updateMallocCounter(nbytes);
   zone->addCellMemory(obj, nbytes, js::MemoryUse(use));
   zone->runtimeFromMainThread()->gc.maybeAllocTriggerZoneGC(zone);
 }
 
 JS_PUBLIC_API void JS::RemoveAssociatedMemory(JSObject* obj, size_t nbytes,
                                               JS::MemoryUse use) {
   MOZ_ASSERT(obj);
   if (!nbytes) {