Bug 36650 - [Qt] Add API for reporting additional memory cost of JavaScript objects
Summary: [Qt] Add API for reporting additional memory cost of JavaScript objects
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Kent Hansen
Keywords: Qt
Depends on:
Blocks: 31863
  Show dependency treegraph
Reported: 2010-03-26 03:24 PDT by Kent Hansen
Modified: 2010-03-28 03:43 PDT (History)
2 users (show)

See Also:

Proposed patch (5.82 KB, patch)
2010-03-26 03:30 PDT, Kent Hansen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.