Changeset 122462 in webkit


Ignore:
Timestamp:
Jul 12, 2012 8:34:35 AM (12 years ago)
Author:
allan.jensen@nokia.com
Message:

[Qt] Implement MemoryUsageSupport
https://bugs.webkit.org/show_bug.cgi?id=91094

Reviewed by Adam Barth.

Source/JavaScriptCore:

Compile in MemoryStatistics so we can make use of the interface.

  • Target.pri:

Source/WebCore:

Implements Qt versions of the memory-usage functions using the information we have available
from the various memory systems used in WebKit.

Also gets rid of a redundant indirection in V8GCController.

  • Target.pri:
  • bindings/v8/V8GCController.cpp:

(WebCore::V8GCController::gcEpilogue):
(WebCore::V8GCController::checkMemoryUsage):

  • platform/qt/MemoryUsageSupportQt.cpp: Added.

(WebCore::mallocMemoryUsage):
(WebCore::memoryUsageKB):
(WebCore::actualMemoryUsageKB):
(WebCore::MemoryUsageSupport::memoryUsageMB):
(WebCore::MemoryUsageSupport::actualMemoryUsageMB):
(WebCore::MemoryUsageSupport::lowMemoryUsageMB):
(WebCore::MemoryUsageSupport::highMemoryUsageMB):
(WebCore::MemoryUsageSupport::highUsageDeltaMB):
(WebCore::MemoryUsageSupport::processMemorySizesInBytes):

  • platform/qt/PlatformSupport.h:

(PlatformSupport):

Location:
trunk/Source
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r122423 r122462  
     12012-07-12  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        [Qt] Implement MemoryUsageSupport
     4        https://bugs.webkit.org/show_bug.cgi?id=91094
     5
     6        Reviewed by Adam Barth.
     7
     8        Compile in MemoryStatistics so we can make use of the interface.
     9
     10        * Target.pri:
     11
    1122012-07-12  Csaba Osztrogonác  <ossy@webkit.org>
    213
  • trunk/Source/JavaScriptCore/Target.pri

    r122385 r122462  
    219219    runtime/Lookup.cpp \
    220220    runtime/MathObject.cpp \
     221    runtime/MemoryStatistics.cpp \
    221222    runtime/NameConstructor.cpp \
    222223    runtime/NameInstance.cpp \
  • trunk/Source/WebCore/ChangeLog

    r122460 r122462  
     12012-07-12  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        [Qt] Implement MemoryUsageSupport
     4        https://bugs.webkit.org/show_bug.cgi?id=91094
     5
     6        Reviewed by Adam Barth.
     7
     8        Implements Qt versions of the memory-usage functions using the information we have available
     9        from the various memory systems used in WebKit.
     10
     11        Also gets rid of a redundant indirection in V8GCController.
     12
     13        * Target.pri:
     14        * bindings/v8/V8GCController.cpp:
     15        (WebCore::V8GCController::gcEpilogue):
     16        (WebCore::V8GCController::checkMemoryUsage):
     17        * platform/qt/MemoryUsageSupportQt.cpp: Added.
     18        (WebCore::mallocMemoryUsage):
     19        (WebCore::memoryUsageKB):
     20        (WebCore::actualMemoryUsageKB):
     21        (WebCore::MemoryUsageSupport::memoryUsageMB):
     22        (WebCore::MemoryUsageSupport::actualMemoryUsageMB):
     23        (WebCore::MemoryUsageSupport::lowMemoryUsageMB):
     24        (WebCore::MemoryUsageSupport::highMemoryUsageMB):
     25        (WebCore::MemoryUsageSupport::highUsageDeltaMB):
     26        (WebCore::MemoryUsageSupport::processMemorySizesInBytes):
     27        * platform/qt/PlatformSupport.h:
     28        (PlatformSupport):
     29
    1302012-07-12  Vsevolod Vlasov  <vsevik@chromium.org>
    231
  • trunk/Source/WebCore/Target.pri

    r122445 r122462  
    11681168    platform/Logging.cpp \
    11691169    platform/MemoryPressureHandler.cpp \
    1170     platform/MemoryUsageSupport.cpp \
     1170    platform/qt/MemoryUsageSupportQt.cpp \
    11711171    platform/MIMETypeRegistry.cpp \
    11721172    platform/mock/DeviceMotionClientMock.cpp \
  • trunk/Source/WebCore/bindings/v8/V8GCController.cpp

    r121047 r122462  
    476476namespace {
    477477
    478 int getMemoryUsageInMB()
    479 {
    480 #if PLATFORM(CHROMIUM)
    481     return MemoryUsageSupport::memoryUsageMB();
    482 #else
    483     return 0;
    484 #endif
    485 }
    486 
    487 int getActualMemoryUsageInMB()
    488 {
    489 #if PLATFORM(CHROMIUM)
    490     return MemoryUsageSupport::actualMemoryUsageMB();
    491 #else
    492     return 0;
    493 #endif
    494 }
    495478
    496479}  // anonymous namespace
     
    507490    visitActiveDOMNodes(&epilogueNodeVisitor);
    508491
    509     workingSetEstimateMB = getActualMemoryUsageInMB();
     492    workingSetEstimateMB = MemoryUsageSupport::actualMemoryUsageMB();
    510493
    511494#ifndef NDEBUG
     
    531514    const int highMemoryUsageMB = MemoryUsageSupport::highMemoryUsageMB();
    532515    const int highUsageDeltaMB = MemoryUsageSupport::highUsageDeltaMB();
    533     int memoryUsageMB = getMemoryUsageInMB();
     516    int memoryUsageMB = MemoryUsageSupport::memoryUsageMB();
    534517    if ((memoryUsageMB > lowMemoryUsageMB && memoryUsageMB > 2 * workingSetEstimateMB) || (memoryUsageMB > highMemoryUsageMB && memoryUsageMB > workingSetEstimateMB + highUsageDeltaMB))
    535518        v8::V8::LowMemoryNotification();
  • trunk/Source/WebCore/platform/qt/PlatformSupport.h

    r95901 r122462  
    9393    static NPObject* pluginScriptableObject(Widget*);
    9494
    95     // If memory usage is below this threshold, do not bother forcing GC.
    96     static int lowMemoryUsageMB() { return 256; }
    97 
    98     // If memory usage is above this threshold, force GC more aggressively.
    99     static int highMemoryUsageMB() { return 1024; }
    100 
    101     // Delta of memory usage growth (vs. last actualMemoryUsageMB()) to force GC when memory usage is high.
    102     static int highUsageDeltaMB() { return 128; }
    10395};
    10496
Note: See TracChangeset for help on using the changeset viewer.