    LOGGER_TRACE << "initialised V8 context #" << i;
  
 diff --git a/arangod/V8Server/ApplicationV8.h b/arangod/V8Server/ApplicationV8.h
-index a4fa6bd..e91304d 100644
+index 62b0474..f6d485e 100644
 --- a/arangod/V8Server/ApplicationV8.h
 +++ b/arangod/V8Server/ApplicationV8.h
 @@ -91,7 +91,19 @@ namespace triagens {

 
       if (_dirtyContexts.empty()) {
-        guard.wait();
+        // check whether we got a wait timeout or a signal
+        gotSignal = guard.wait(waitTime);
       }
 
       if (! _dirtyContexts.empty()) {
         context = _dirtyContexts.back();
         _dirtyContexts.pop_back();
       }
+
+      if (context == 0 && ! gotSignal && ! _freeContexts.empty()) {
+        // we timed out waiting for a signal
+        // so we'll pop one of the free contexts and clean it up pro-actively
+        context = _freeContexts.back();
+        if (context != 0) {
+          _freeContexts.pop_back();
+        }
+      }
     }
+   
+    // update last gc time   

 
     if (context != 0) {
       LOGGER_TRACE << "collecting V8 garbage";
@@ -288,6 +414,7 @@ void ApplicationV8::collectGarbage () {
       delete context->_locker;
 
       context->_dirt = 0;
