Bug 75610 - push/shift fifo may consume excessive memory
Summary: push/shift fifo may consume excessive memory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 75140
  Show dependency treegraph
 
Reported: 2012-01-05 01:05 PST by Gavin Barraclough
Modified: 2012-01-05 11:35 PST (History)
2 users (show)

See Also:


Attachments
Fix (4.45 KB, patch)
2012-01-05 01:13 PST, Gavin Barraclough
sam: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2012-01-05 01:05:48 PST
Array object commonly store data in a vector, consisting of a portion that is in use, a pre-capacity (m_indexBias) and a post-capacity (the delta between m_length and m_vectorLength).  Calls to shift with grow the pre-capacity, and the current algorithm for increaseVectorLength (used by push, or [[Put]]) will never shrink the pre-capacity, so a push/shift fifo may consume an inordinate amount of memory, whilst having a relatively small active length.
Comment 1 Gavin Barraclough 2012-01-05 01:13:17 PST
Created attachment 121237 [details]
Fix

10% overall speedup on the micro-benchmark attached to bug #75588 , largely due to a 20x speedup on the two smaller fifo tests (I think this makes sense - they'll currently be serving as tests for the OS's memory allocation speed!)
Comment 2 WebKit Review Bot 2012-01-05 09:40:03 PST
Comment on attachment 121237 [details]
Fix

Attachment 121237 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11146007

New failing tests:
http/tests/inspector/network/download.html
Comment 3 Gavin Barraclough 2012-01-05 11:19:24 PST
(In reply to comment #2)
> (From update of attachment 121237 [details])
> Attachment 121237 [details] did not pass chromium-ews (chromium-xvfb):
> Output: http://queues.webkit.org/results/11146007
> 
> New failing tests:
> http/tests/inspector/network/download.html

Works for me, and this bug doesn't affect Chromium.  Bad EWS.
Comment 4 Gavin Barraclough 2012-01-05 11:35:28 PST
Fixed in 104184.