Ignore:
Timestamp:
May 22, 2012, 12:17:57 PM (13 years ago)
Author:
[email protected]
Message:

GC allocation trigger should be tuned to system RAM
https://bugs.webkit.org/show_bug.cgi?id=87039

Reviewed by Darin Adler.

../JavaScriptCore:

This helps avoid OOM crashes on small platforms, and helps avoid "too much GC"
performance issues on big platforms.

  • heap/Heap.cpp:

(JSC::Heap::Heap):
(JSC::Heap::collect):

  • heap/Heap.h:

(Heap): GC balances between a fixed minimum and a proportional multiplier,
which are limited based on system RAM.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::createContextGroup):
(JSC::JSGlobalData::create):
(JSC::JSGlobalData::createLeaked):

  • runtime/JSGlobalData.h:

(JSGlobalData): Renamed HeapSize to HeapType because the exact size is
influenced by the heap type, but not determined by it.

../WTF:

Added a helper function for measuring system RAM.

  • GNUmakefile.list.am:
  • WTF.gypi:
  • WTF.pro:
  • WTF.vcproj/WTF.vcproj:
  • WTF.xcodeproj/project.pbxproj:
  • wtf/AmountOfRAM.cpp: Added.

(WTF):
(WTF::computeAmountOfRAM):
(WTF::amountOfRAM):

  • wtf/AmountOfRAM.h: Added.

(WTF):

  • wtf/CMakeLists.txt:
  • wtf/StdLibExtras.h:

(WTF):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r117859 r118019  
    119119#endif
    120120
    121 JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType threadStackType, HeapSize heapSize)
    122     : heap(this, heapSize)
     121JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType threadStackType, HeapType heapType)
     122    : heap(this, heapType)
    123123    , globalDataType(globalDataType)
    124124    , clientData(0)
     
    291291}
    292292
    293 PassRefPtr<JSGlobalData> JSGlobalData::createContextGroup(ThreadStackType type, HeapSize heapSize)
    294 {
    295     return adoptRef(new JSGlobalData(APIContextGroup, type, heapSize));
    296 }
    297 
    298 PassRefPtr<JSGlobalData> JSGlobalData::create(ThreadStackType type, HeapSize heapSize)
    299 {
    300     return adoptRef(new JSGlobalData(Default, type, heapSize));
    301 }
    302 
    303 PassRefPtr<JSGlobalData> JSGlobalData::createLeaked(ThreadStackType type, HeapSize heapSize)
    304 {
    305     return create(type, heapSize);
     293PassRefPtr<JSGlobalData> JSGlobalData::createContextGroup(ThreadStackType type, HeapType heapType)
     294{
     295    return adoptRef(new JSGlobalData(APIContextGroup, type, heapType));
     296}
     297
     298PassRefPtr<JSGlobalData> JSGlobalData::create(ThreadStackType type, HeapType heapType)
     299{
     300    return adoptRef(new JSGlobalData(Default, type, heapType));
     301}
     302
     303PassRefPtr<JSGlobalData> JSGlobalData::createLeaked(ThreadStackType type, HeapType heapType)
     304{
     305    return create(type, heapType);
    306306}
    307307
Note: See TracChangeset for help on using the changeset viewer.