[Webkit-unassigned] [Bug 65382] The JSC garbage collector returns memory to the operating system too eagerly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 30 20:37:30 PDT 2011


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





--- Comment #10 from Oliver Hunt <oliver at apple.com>  2011-07-30 20:37:30 PST ---
(In reply to comment #9)
> (In reply to comment #8)
> > (From update of attachment 102448 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=102448&action=review
> > 
> > Not r+/r- because i don't understand why this doesn't lead to the main thread blocking on the release-thread
> > 
> > > Source/JavaScriptCore/heap/Heap.cpp:319
> > > +    MutexLocker locker(m_freeBlockLock);
> > 
> > Do we really want to wait while holding the freeBlock lock?  It looks like that would lead to allocateBlock blocking for up to a second on this secondary thread?
> 
> ThreadCondition::timedWait(Mutex, double) should atomically release the Mutex and engage the wait.  So allocateBlock() may wait for the handful of microseconds that it takes to acquire the Mutex and commence waiting, but never a full second (well unless the scavenger thread page faults or something, and the page fault is super-expensive, or something).

righto

> > 
> > > Source/JavaScriptCore/heap/Heap.h:39
> > > +#if ENABLE(SINGLE_THREADED)
> > > +#define HEAP_FREE_BLOCKS_EAGERLY 1
> > > +#else
> > > +#define HEAP_FREE_BLOCKS_EAGERLY 0
> > > +#endif
> > 
> > I think this would read better in general if this became WTF_ENABLE_EAGER_BLOCK_FREEING, and then the call sites work can be guarded with ENABLE(EAGER_BLOCK_FREEING) which is our more typical approach.
> 
> I presume you would recommend putting this in wtf/Platform?  Or is it better to keep it in Heap.h?

I initially thought putting it in Platform.h would be better, but i'm not sure we really need to have this setting trigger a world rebuild, so i decided not to suggest it :D

-- 
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