Bug 113507 - Web Inspector: add memory instrumentation for StringBuffer
Summary: Web Inspector: add memory instrumentation for StringBuffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 08:25 PDT by Yury Semikhatsky
Modified: 2013-04-01 02:39 PDT (History)
16 users (show)

See Also:


Attachments
Patch (4.77 KB, patch)
2013-03-28 08:27 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (7.23 KB, patch)
2013-03-29 05:47 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (1.73 KB, patch)
2013-03-29 06:52 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2013-03-28 08:25:07 PDT
We see quite big blocks allocated by StringBuffer, they should be instrumented.
Comment 1 Yury Semikhatsky 2013-03-28 08:27:10 PDT
Created attachment 195572 [details]
Patch
Comment 2 Ilya Tikhonovsky 2013-03-28 08:55:39 PDT
Comment on attachment 195572 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=195572&action=review

> Source/WTF/wtf/MemoryInstrumentationString.h:77
> +    MemoryClassInfo info(memoryObjectInfo, stringBuffer->characters(), 0, sizeof(CharType) * stringBuffer->length());

You have to report the address of stringBuffer and report characters() as the member.
if it is a part of memory chunk of stringBuilder then you need to calculate the size for stringBuilder explicitly.
See the instrumentation for String.
Comment 3 Build Bot 2013-03-28 09:02:39 PDT
Comment on attachment 195572 [details]
Patch

Attachment 195572 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17358068
Comment 4 Yury Semikhatsky 2013-03-29 05:47:06 PDT
Created attachment 195730 [details]
Patch
Comment 5 Yury Semikhatsky 2013-03-29 05:47:42 PDT
(In reply to comment #2)
> (From update of attachment 195572 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=195572&action=review
> 
> > Source/WTF/wtf/MemoryInstrumentationString.h:77
> > +    MemoryClassInfo info(memoryObjectInfo, stringBuffer->characters(), 0, sizeof(CharType) * stringBuffer->length());
> 
> You have to report the address of stringBuffer and report characters() as the member.
> if it is a part of memory chunk of stringBuilder then you need to calculate the size for stringBuilder explicitly.
> See the instrumentation for String.

You're right. Fixed.
Comment 6 Ilya Tikhonovsky 2013-03-29 06:26:48 PDT
Comment on attachment 195730 [details]
Patch

please extract libjpeg change into a separate patch
Comment 7 Yury Semikhatsky 2013-03-29 06:52:43 PDT
Created attachment 195738 [details]
Patch
Comment 8 Ilya Tikhonovsky 2013-03-29 06:54:04 PDT
Comment on attachment 195738 [details]
Patch

LGTM
Comment 9 WebKit Review Bot 2013-04-01 02:39:49 PDT
Comment on attachment 195738 [details]
Patch

Clearing flags on attachment: 195738

Committed r147313: <http://trac.webkit.org/changeset/147313>
Comment 10 WebKit Review Bot 2013-04-01 02:39:54 PDT
All reviewed patches have been landed.  Closing bug.