Calling a GC on clear cache is a heuristic, to try to find a good time to do a large GC. The thinking behind it was that clear cache would be called when memory was almost exhausted, and that it would be a good idea for V8 to reduce its memory usage at that point. It was expected that the clear cache event would be very rare.
Is 'clear cache' happening a lot? In general a GCed system will often slow down dramatically just before running out of memory. Also, running out of memory is not a recoverable event. So it's best if you can avoid running out of memory. :-) Den 18. jun. 2010 11.25 skrev zaheer ahmad <[email protected]>: > hi, > iam running some page cycler tests on android (with v8 - June 4 > Bleeding Edge) that invoke LowMemoryCondition on every cycle (through > ClearCache). I have very limited js in my tests <0.5% evaluation time, > even then every request seems to be taking ~200-300ms. Is this a known > issue? if not i can hopefully simulate a test case. > > In addition, the trigger ClearCache which is primarily a disk clear > request may not be triggering a Low memory request IMO. > Interestingly the JSC version in this case is quite fast (though it > also seems be doing a compact). i havent checked the internals though. > > #if USE(JSC) > // force JavaScript to GC when clear cache > WebCore::gcController().garbageCollectSoon(); > #elif USE(V8) > WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj); > pFrame->script()->lowMemoryNotification(); > #endif // USE(JSC) > > Thanks in advance for any inputs. > > Regards, > Zaheer > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- Erik Corry, Software Engineer Google Denmark ApS. CVR nr. 28 86 69 84 c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 Copenhagen K, Denmark. -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
