[Webkit-unassigned] [Bug 111094] [Qt] QWebSettings::clearMemoryCaches should clear JS garbage

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 6 06:54:49 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=111094





--- Comment #22 from Arunprasad <ararunprasad at gmail.com>  2013-03-06 06:57:13 PST ---
(In reply to comment #21)
> (From update of attachment 191508 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=191508&action=review
> 
> > Source/WebKit/qt/Api/qwebsettings.cpp:853
> > +    // Garbage Collect to release the references of CachedResource from dead objects
> > +    WebCore::gcController().garbageCollectNow();
> 
> You don't need to call garbageCollect when you call discardAllCompiledCode. It does that as well.

>From Heap.cpp
void Heap::deleteAllCompiledCode()
{
    // If JavaScript is running, it's not safe to delete code, since we'll end
    // up deleting code that is live on the stack.
    if (m_globalData->dynamicGlobalObject)
        return;

    for (ExecutableBase* current = m_compiledCode.head(); current; current = current->next()) {
        if (!current->isFunctionExecutable())
            continue;
        static_cast<FunctionExecutable*>(current)->clearCodeIfNotCompiling();
    }

    m_dfgCodeBlocks.clearMarks();
    m_dfgCodeBlocks.deleteUnmarkedJettisonedCodeBlocks();
}


I think it is not calling GarbageCollector. Sorry incase i'm wrong. Can you please show me where it is calling the GC?

> 
> > Source/WebKit/qt/Api/qwebsettings.cpp:868
> > +    // FastMalloc has lock-free thread specific caches that can only be cleared from the thread itself.
> > +    WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThreads();
> > +#if ENABLE(WORKERS)
> > +    WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads();
> > +#endif
> > +#if ENABLE(THREADED_SCROLLING)
> > +    WebCore::ScrollingThread::dispatch(bind(WTF::releaseFastMallocFreeMemory));
> > +#endif
> > +    WTF::releaseFastMallocFreeMemory();    
> 
> I would skip these for now. They are not really caches, and we also don't support scrolling threads.

 +    WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThreads();
 +#if ENABLE(WORKERS)
 +    WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads();
 +#endif
 +    WTF::releaseFastMallocFreeMemory();

Anyhow releasing Workers and FastMalloc stuffs needed know?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list