FastMalloc statistics (reservedFastMalloc, committedFastMalloc, freeListFastMalloc) should be exposed in window.internals, to be used for bug 78984 and bug 90858 Also see bug 91204 for more background.
What is the progress of the patch? Are you working on it?
I could use some advice about the interfaces. Should we duplicate (move?) the MemoryInfo object in window.internals? Or do we just add new interfaces for the malloc stats directly in window.internals? unsigned long reservedVMBytes(); unsigned long committedVMBytes(); unsigned long freeListVMBytes();
(In reply to comment #2) > I could use some advice about the interfaces. > Should we duplicate (move?) the MemoryInfo object in window.internals? We shouldn't duplicate. > Or do we just add new interfaces for the malloc stats directly in window.internals? > unsigned long reservedVMBytes(); > unsigned long committedVMBytes(); > unsigned long freeListVMBytes(); I think this would be just fine.
(In reply to comment #2) > unsigned long reservedVMBytes(); > unsigned long committedVMBytes(); > unsigned long freeListVMBytes(); Reserved and committed will be enough for us.
Created attachment 153017 [details] Patch
Is there any test I can add?
Comment on attachment 153017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153017&action=review > Source/WebCore/testing/Internals.idl:181 > + unsigned long reservedVMBytes(); > + unsigned long committedVMBytes(); > + unsigned long freeListBytes(); Would have been better if you've added a property like fastMallocStatistics and added these methods there. Also, we should make these readonly properties instead of methods.
I just followed Zoltan's advice in comment #3, but ok, I can move that into a new Source/WebCore/testing/FastMallocStatistics.idl with read-only attributes. What kind of tests can I add? Would it be ok to just check for definedness and having attributes >= 0?
(In reply to comment #8) > I just followed Zoltan's advice in comment #3, but ok, I can move that into a new Source/WebCore/testing/FastMallocStatistics.idl with read-only attributes. > > What kind of tests can I add? > Would it be ok to just check for definedness and having attributes >= 0? Yes. Maybe you can add it to LayoutTests/fast/harness?
Created attachment 153276 [details] Patch
This patch is still missing tests and more build system integration. Zoltan, Ryosuke: am I going in the good direction for your needs?
Comment on attachment 153276 [details] Patch Attachment 153276 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13269957
Comment on attachment 153276 [details] Patch Attachment 153276 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13278925
Comment on attachment 153276 [details] Patch Attachment 153276 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/13279998
Created attachment 153308 [details] Patch
Comment on attachment 153308 [details] Patch Attachment 153308 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13272910
Comment on attachment 153308 [details] Patch Attachment 153308 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13307009
Comment on attachment 153308 [details] Patch Attachment 153308 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/13301066
Created attachment 153346 [details] Patch
Comment on attachment 153346 [details] Patch Attachment 153346 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13305059
Created attachment 153459 [details] Patch
Created attachment 153475 [details] Patch remove double changelog entries
Comment on attachment 153475 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153475&action=review > Source/WebCore/testing/FastMallocStatistics.h:46 > + m_stats = WTF::fastMallocStatistics(); If we're storing the statistics at the object creation, then we probably need to make the creation explicit instead of making it hang off of internals. > Source/WebCore/testing/Internals.idl:179 > + readonly attribute FastMallocStatistics fastMallocStatistics; i.e. this should be a function call instead of being an object in order to allow getting statistics multiple times without being dependent on GC behavior. > LayoutTests/fast/harness/fastmallocstatistics-object.html:1 > +<html> Missing DOCTYPE.
(In reply to comment #23) > (From update of attachment 153475 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=153475&action=review > > > Source/WebCore/testing/FastMallocStatistics.h:46 > > + m_stats = WTF::fastMallocStatistics(); > > If we're storing the statistics at the object creation, then we probably need to make the creation explicit instead of making it hang off of internals. > > > Source/WebCore/testing/Internals.idl:179 > > + readonly attribute FastMallocStatistics fastMallocStatistics; > > i.e. this should be a function call instead of being an object in order to allow getting statistics multiple times without being dependent on GC behavior. Thanks, I will change it to a function call. I followed the model used for console.memory, which uses a readonly attribute as well. Does it mean that getting fresh stats in console.memory would depend on the GC? > > LayoutTests/fast/harness/fastmallocstatistics-object.html:1 > > +<html> > > Missing DOCTYPE. Ok, I will add one (some tests in the harness dir are missing it as well). Thanks for the review
Created attachment 154632 [details] Patch
This update converts the readonly attribute in window.internals to a function, and adds a DOCTYPE to the test. The Xcode project has been manually edited to add the new files (with manually generated GUIDs), but it seems it eventually passed the MaC bot.
Comment on attachment 154632 [details] Patch Yay! Looks great to me.
Comment on attachment 154632 [details] Patch Clearing flags on attachment: 154632 Committed r123773: <http://trac.webkit.org/changeset/123773>
All reviewed patches have been landed. Closing bug.