WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
100659
Memory instrumentation: report actual object address for CachedResourceClients
https://bugs.webkit.org/show_bug.cgi?id=100659
Summary
Memory instrumentation: report actual object address for CachedResourceClients
Yury Semikhatsky
Reported
2012-10-29 05:34:57 PDT
There are several implementations of CachedResourceClients which have multiple parent classes and thus CachedResourceClient* is different from the actual pointer. This can be fixed by adding CachedResourceClient::reportMemoryUsage which would return actual object address.
Attachments
Patch
(56.02 KB, patch)
2012-10-29 05:43 PDT
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(57.10 KB, patch)
2012-10-29 06:27 PDT
,
Yury Semikhatsky
webkit-ews
: commit-queue-
Details
Formatted Diff
Diff
Patch
(65.70 KB, patch)
2012-10-29 08:28 PDT
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(74.13 KB, patch)
2012-10-29 21:45 PDT
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(2.62 KB, patch)
2012-10-30 01:57 PDT
,
Yury Semikhatsky
apavlov
: review+
apavlov
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2012-10-29 05:43:45 PDT
Created
attachment 171212
[details]
Patch
Early Warning System Bot
Comment 2
2012-10-29 05:53:46 PDT
Comment on
attachment 171212
[details]
Patch
Attachment 171212
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/14640068
Early Warning System Bot
Comment 3
2012-10-29 05:56:28 PDT
Comment on
attachment 171212
[details]
Patch
Attachment 171212
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/14629113
Build Bot
Comment 4
2012-10-29 06:07:14 PDT
Comment on
attachment 171212
[details]
Patch
Attachment 171212
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/14618724
Build Bot
Comment 5
2012-10-29 06:09:39 PDT
Comment on
attachment 171212
[details]
Patch
Attachment 171212
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14626152
Yury Semikhatsky
Comment 6
2012-10-29 06:27:04 PDT
Created
attachment 171225
[details]
Patch
Early Warning System Bot
Comment 7
2012-10-29 06:37:11 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/14630106
Early Warning System Bot
Comment 8
2012-10-29 06:37:46 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/14631118
Build Bot
Comment 9
2012-10-29 07:01:48 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/14625161
Ilya Tikhonovsky
Comment 10
2012-10-29 07:06:33 PDT
View in context:
https://bugs.webkit.org/attachment.cgi?id=171225&action=review
> Source/WebCore/css/CachedSVGDocumentReference.h:45 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
What do you think about WebCoreMemoryTypes::SVG = "Page.SVG"
> Source/WebCore/dom/PendingScript.cpp:71 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
What do you think about WebCoreMemoryTypes::Script = "Page.Script"
> Source/WebCore/html/HTMLDocument.h:82 > + virtual void reportMemoryUsage(MemoryObjectInfo*) const;
OVERRIDE
> Source/WebCore/html/HTMLLinkElement.cpp:401 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
DOM?
> Source/WebCore/html/HTMLLinkElement.h:91 > + virtual void reportMemoryUsage(MemoryObjectInfo*) const;
OVERRIDE
> Source/WebCore/html/HTMLScriptElement.h:69 > + virtual void reportMemoryUsage(MemoryObjectInfo*) const;
OVERRIDE
> Source/WebCore/html/parser/HTMLDocumentParser.h:82 > + virtual void reportMemoryUsage(MemoryObjectInfo*) const;
ditto
> Source/WebCore/rendering/RenderObject.cpp:2843 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::RenderTreeUsed, 0);
as we discussed offline that it'd be nice to have customAllocated flag on MemoryObjectInfo which indicates that this object was allocated in RenderArena and shouldn't be counted.
> Source/WebCore/svg/SVGFEImageElement.cpp:207 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
SVG?
> Source/WebCore/svg/SVGFontFaceUriElement.cpp:95 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
SVG?
> Source/WebCore/svg/SVGScriptElement.cpp:217 > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
SVG
Yury Semikhatsky
Comment 11
2012-10-29 07:28:46 PDT
(In reply to
comment #10
)
> View in context:
https://bugs.webkit.org/attachment.cgi?id=171225&action=review
> > > Source/WebCore/css/CachedSVGDocumentReference.h:45 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); > > What do you think about WebCoreMemoryTypes::SVG = "Page.SVG" >
Added.
> > Source/WebCore/dom/PendingScript.cpp:71 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); > > What do you think about WebCoreMemoryTypes::Script = "Page.Script" >
We don't report scripts separately yet.
> > Source/WebCore/html/HTMLDocument.h:82 > > + virtual void reportMemoryUsage(MemoryObjectInfo*) const; > > OVERRIDE >
Done.
> > Source/WebCore/html/HTMLLinkElement.cpp:401 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); > > DOM? >
Done.
> > Source/WebCore/html/HTMLLinkElement.h:91 > > + virtual void reportMemoryUsage(MemoryObjectInfo*) const; > > OVERRIDE >
Done.
> > Source/WebCore/html/HTMLScriptElement.h:69 > > + virtual void reportMemoryUsage(MemoryObjectInfo*) const; > > OVERRIDE >
Done.
> > Source/WebCore/html/parser/HTMLDocumentParser.h:82 > > + virtual void reportMemoryUsage(MemoryObjectInfo*) const; > > ditto >
Done.
> > Source/WebCore/rendering/RenderObject.cpp:2843 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::RenderTreeUsed, 0); > > as we discussed offline that it'd be nice to have customAllocated flag on MemoryObjectInfo which indicates that this object was allocated in RenderArena and shouldn't be counted. >
Done.
> > Source/WebCore/svg/SVGFEImageElement.cpp:207 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); > > SVG? >
Done.
> > Source/WebCore/svg/SVGFontFaceUriElement.cpp:95 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); > > SVG? >
Done.
> > Source/WebCore/svg/SVGScriptElement.cpp:217 > > + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); > > SVG
Done.
EFL EWS Bot
Comment 12
2012-10-29 07:36:39 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/14640103
Build Bot
Comment 13
2012-10-29 07:54:08 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14631137
kov's GTK+ EWS bot
Comment 14
2012-10-29 08:09:13 PDT
Comment on
attachment 171225
[details]
Patch
Attachment 171225
[details]
did not pass gtk-ews (gtk): Output:
http://queues.webkit.org/results/14630139
Yury Semikhatsky
Comment 15
2012-10-29 08:28:40 PDT
Created
attachment 171252
[details]
Patch
Ilya Tikhonovsky
Comment 16
2012-10-29 08:39:39 PDT
Comment on
attachment 171252
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171252&action=review
lgtm
> Source/WebCore/rendering/RenderObject.cpp:2843 > + memoryObjectInfo->setCustomAllocator();
Actually RenderObject allocates in heap in debug mode.
Build Bot
Comment 17
2012-10-29 08:53:19 PDT
Comment on
attachment 171252
[details]
Patch
Attachment 171252
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14630147
EFL EWS Bot
Comment 18
2012-10-29 09:30:30 PDT
Comment on
attachment 171252
[details]
Patch
Attachment 171252
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/14640128
kov's GTK+ EWS bot
Comment 19
2012-10-29 09:59:03 PDT
Comment on
attachment 171252
[details]
Patch
Attachment 171252
[details]
did not pass gtk-ews (gtk): Output:
http://queues.webkit.org/results/14631176
Yury Semikhatsky
Comment 20
2012-10-29 21:45:04 PDT
Created
attachment 171369
[details]
Patch
Yury Semikhatsky
Comment 21
2012-10-29 22:50:21 PDT
(In reply to
comment #20
)
> Created an attachment (id=171369) [details] > Patch
CachedResourceClient::reportMemoryUsage is pure virtual function while other methods in the clients have default implementation. It is hard to provide a meaningful default implementation for reportMemoryUsage so I tried to update all existing implementations of the client interface and left the method pure virtual for now. I could change it to report the object as having custom allocator by default which would compile but report no information about the client if the method is not overriden. Let me know if you want me to do the change.
Build Bot
Comment 22
2012-10-29 23:18:15 PDT
Comment on
attachment 171369
[details]
Patch
Attachment 171369
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14629394
Yury Semikhatsky
Comment 23
2012-10-30 01:57:04 PDT
Created
attachment 171401
[details]
Patch
Yury Semikhatsky
Comment 24
2012-10-30 02:01:50 PDT
(In reply to
comment #23
)
> Created an attachment (id=171401) [details] > Patch
After offline discussion I changed the approach to simply skip CachedResourceClients. Otherwise we would try to report uncontrolled set of clients and their implementation details through the abstract interface. If we want to report the client's memory usage we should do this through the client's owner instead. General approach to the memory graph traversal should sound like "report memory usage only for objects owned by the current one".
Yury Semikhatsky
Comment 25
2012-10-30 02:03:35 PDT
(In reply to
comment #23
)
> Created an attachment (id=171401) [details] > Patch
This change reduces number of reported objects that are not allocated by the memory allocator from >350 to 4 on Chromium build and nytimes.com
Ilya Tikhonovsky
Comment 26
2012-10-30 02:04:31 PDT
Comment on
attachment 171401
[details]
Patch lgtm
Alexander Pavlov (apavlov)
Comment 27
2012-10-30 02:09:01 PDT
Comment on
attachment 171401
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=171401&action=review
> Source/WebCore/ChangeLog:8 > + Skiped pointers to objects that are not allocated on the heap directly.
Skiped -> Skipped
> Source/WebCore/ChangeLog:11 > + insrumentation with those allocated by the memory allocator. Latter set should
The latter set...
Yury Semikhatsky
Comment 28
2012-10-30 02:11:29 PDT
(In reply to
comment #27
)
> (From update of
attachment 171401
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=171401&action=review
> > > Source/WebCore/ChangeLog:8 > > + Skiped pointers to objects that are not allocated on the heap directly. > > Skiped -> Skipped >
Done.
> > Source/WebCore/ChangeLog:11 > > + insrumentation with those allocated by the memory allocator. Latter set should > > The latter set...
Done.
Yury Semikhatsky
Comment 29
2012-10-30 02:16:01 PDT
Committed
r132884
: <
http://trac.webkit.org/changeset/132884
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug