Bug 114709

Summary: Repeated use of decodeAudioData() causes leak
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, crogers, eric.carlson, esprehn+autocc, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ggaren: review+, eflews.bot: commit-queue-

Description Jer Noble 2013-04-16 15:28:28 PDT
Repeated use of decodeAudioData() causes leak
Comment 1 Jer Noble 2013-04-16 15:28:48 PDT
I made a test case that uses a single arrayBuffer to feed repeated calls to decodeAudioData() and see the "leak".  But it's not really a "leak", per se.  It's just that the garbage collector doesn't know how big these audio buffers actually are.  Once their size is correctly reported to the GC, they are deleted much more rapidly, and a steady state of only a few live objects is attained.
Comment 2 Jer Noble 2013-04-16 15:30:09 PDT
<rdar://problem/12804159>
Comment 3 Jer Noble 2013-04-16 15:34:57 PDT
Created attachment 198445 [details]
Patch
Comment 4 WebKit Commit Bot 2013-04-16 15:38:04 PDT
Attachment 198445 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/Modules/webaudio/AudioBuffer.cpp', u'Source/WebCore/Modules/webaudio/AudioBuffer.h', u'Source/WebCore/Modules/webaudio/AudioBuffer.idl', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/bindings/js/JSAudioBufferCustom.cpp']" exit_code: 1
Source/WebCore/bindings/js/JSAudioBufferCustom.cpp:27:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Jer Noble 2013-04-16 15:45:09 PDT
Created attachment 198448 [details]
Patch

Address the stylebot's review.
Comment 6 Geoffrey Garen 2013-04-16 15:54:12 PDT
Comment on attachment 198448 [details]
Patch

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

r=me

> Source/WebCore/Modules/webaudio/AudioBuffer.h:71
> +    size_t extraMemoryCost() const;

Slight nit: from the audio buffer's perspective, this is just "cost", not "extra cost".
Comment 7 EFL EWS Bot 2013-04-16 16:05:35 PDT
Comment on attachment 198448 [details]
Patch

Attachment 198448 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/85192
Comment 8 Jer Noble 2013-04-16 16:16:40 PDT
Committed r148566: <http://trac.webkit.org/changeset/148566>