GC allocation trigger should be tuned to system RAM
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 19:17:57 +0000 (19:17 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 19:17:57 +0000 (19:17 +0000)
commit5e06ac6267a1dd591c6288a20e926837080169e8
treef7f9e006ef7af34c219520391486917521e14923
parentb874c52474620e343fa91bb197116626abb95c93
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/runtime/JSGlobalData.cpp
Source/JavaScriptCore/runtime/JSGlobalData.h
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.gypi
Source/WTF/WTF.pro
Source/WTF/WTF.vcproj/WTF.vcproj
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/RAMSize.cpp [new file with mode: 0644]
Source/WTF/wtf/RAMSize.h [new file with mode: 0644]
Source/WTF/wtf/StdLibExtras.h