Ignore:
Timestamp:
Mar 11, 2015, 3:32:19 PM (10 years ago)
Author:
[email protected]
Message:

Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
https://bugs.webkit.org/show_bug.cgi?id=142593

Reviewed by Andreas Kling.

Adopt deprecatedReportExtraMemory as a short-term fix for runaway
memory growth in these cases where we have not adopted
reportExtraMemoryVisited.

Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.

Source/JavaScriptCore:

  • API/JSBase.cpp:

(JSReportExtraMemoryCost):

  • runtime/SparseArrayValueMap.cpp:

(JSC::SparseArrayValueMap::add):

Source/WebCore:

Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::reportExtraMemoryAllocated):

  • bindings/js/JSDocumentCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSNodeListCustom.cpp:

(WebCore::createWrapper):

  • dom/CollectionIndexCache.cpp:

(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::createImageBuffer):

  • html/HTMLImageLoader.cpp:

(WebCore::HTMLImageLoader::imageChanged):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::parseAttribute):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::dropProtection):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.cpp

    r181407 r181411  
    141141    JSLockHolder locker(exec);
    142142
    143     // FIXME: switch to deprecatedReportExtraMemory.
    144     // https://bugs.webkit.org/show_bug.cgi?id=142593
    145     exec->vm().heap.reportExtraMemoryAllocated(size);
     143    exec->vm().heap.deprecatedReportExtraMemory(size);
    146144}
    147145
Note: See TracChangeset for help on using the changeset viewer.