Bug 36650

Summary: [Qt] Add API for reporting additional memory cost of JavaScript objects
Product: WebKit Reporter: Kent Hansen <kent.hansen>
Component: JavaScriptCoreAssignee: Kent Hansen <kent.hansen>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jedrzej.nowacki
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 31863    
Attachments:
Description Flags
Proposed patch none

Description Kent Hansen 2010-03-26 03:24:56 PDT
Currently there's no way to indicate the actual amount of memory consumed by native script objects (i.e. objects that wrap arbitrary data, such as Qt/C++ objects).
This can make the garbage collector unresponsive (not freeing objects as often as it should), because it doesn't know the real cost of all objects (since it doesn't know about the native data).
It would be nice if QtScript had an API for registering this cost, so that the GC can take it into account.
Comment 1 Kent Hansen 2010-03-26 03:30:54 PDT
Created attachment 51723 [details]
Proposed patch

This uses JSC API from JSBasePrivate.h, but see the discussion at https://lists.webkit.org/pipermail/squirrelfish-dev/2010-March/000097.html why this is OK.
Comment 2 Jędrzej Nowacki 2010-03-26 03:43:26 PDT
Look good to me :-)
Comment 3 WebKit Commit Bot 2010-03-28 03:43:15 PDT
Comment on attachment 51723 [details]
Proposed patch

Clearing flags on attachment: 51723

Committed r56689: <http://trac.webkit.org/changeset/56689>
Comment 4 WebKit Commit Bot 2010-03-28 03:43:19 PDT
All reviewed patches have been landed.  Closing bug.