From 8391084c153d5eea67247b629960f170a2b68d04 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Tue, 5 Jan 2016 00:24:32 +0100 Subject: [PATCH] less GC when idle --- arangod/V8Server/ApplicationV8.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arangod/V8Server/ApplicationV8.cpp b/arangod/V8Server/ApplicationV8.cpp index 903e5796d1..5190f2df1e 100644 --- a/arangod/V8Server/ApplicationV8.cpp +++ b/arangod/V8Server/ApplicationV8.cpp @@ -661,8 +661,9 @@ void ApplicationV8::collectGarbage () { ! _dirtyContexts.empty()) { context = _dirtyContexts.back(); _dirtyContexts.pop_back(); - if (context->_numExecutions < 10 && ! context->_hasActiveExternals) { - // don't collect this one + if (context->_numExecutions < 50 && ! context->_hasActiveExternals) { + // don't collect this one yet. it doesn't have externals, so there + // is urge for garbage collection _freeContexts.emplace_back(context); context = nullptr; } @@ -692,8 +693,8 @@ void ApplicationV8::collectGarbage () { gc->updateGcStamp(lastGc); if (context != nullptr) { - // LOG_TRACE("will collect now: %d, numExecutions: %d, hasActive: %d", (int) context->_id, (int) context->_numExecutions, (int) context->_hasActiveExternals); - LOG_TRACE("collecting V8 garbage"); + LOG_TRACE("collecting V8 garbage in context #%d, numExecutions: %d, hasActive: %d, wasDirty: %d", + (int) context->_id, (int) context->_numExecutions, (int) context->_hasActiveExternals, (int) wasDirty); bool hasActiveExternals = false; auto isolate = context->isolate; TRI_ASSERT(context->_locker == nullptr);