From 37fbfa4dc0de361eb05bc34077bdb8eab1113aad Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 25 Mar 2014 10:08:01 +0100 Subject: Be a bit more conservative with allocating memory Cap the max chunk size at 2MB. This value still still doesn't affect the v8 benchmark noticably, but should avoid extreme memory usage in some corner cases Task-number: QTBUG-37134 Change-Id: If2050374c4a7df7ff74194d64880e2d660ea26fd Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4mm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/jsruntime/qv4mm.cpp') diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp index 249ec9589e..8a255e1bad 100644 --- a/src/qml/jsruntime/qv4mm.cpp +++ b/src/qml/jsruntime/qv4mm.cpp @@ -125,7 +125,7 @@ struct MemoryManager::Data , engine(0) , totalItems(0) , totalAlloc(0) - , maxShift(10) + , maxShift(6) , largeItems(0) , deletable(0) { @@ -207,7 +207,7 @@ Managed *MemoryManager::alloc(std::size_t size) // no free item available, allocate a new chunk { - // allocate larger chunks at a time to avoid excessive GC, but cap at maximum chunk size (32MB by default) + // allocate larger chunks at a time to avoid excessive GC, but cap at maximum chunk size (2MB by default) uint shift = ++m_d->nChunks[pos]; if (shift > m_d->maxShift) shift = m_d->maxShift; -- cgit v1.2.3