Bug 16201 - Memory usage increases when a javascript including huge array runs
Summary: Memory usage increases when a javascript including huge array runs
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-30 02:18 PST by Satoshi Ueyama
Modified: 2011-06-15 01:35 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Satoshi Ueyama 2007-11-30 02:18:58 PST
When a javascript program has a huge array, JavascriptCore allocates a large amount of memory blocks while script is running. This problem occurs even though the script doesn't touch the array.

test cases:
 http://svn.coderepos.org/share/lang/javascript/junk/safari-memory-test/test.html
 http://svn.coderepos.org/share/lang/javascript/junk/safari-memory-test/test2.html

In test2.html, the content of the array is commented out and this problem won't occur.

These are results on my computer:

OS:  Windows XP Professional SP2
CPU: Pentium4 3.2GHz
RAM: 2GB

---------------------------------------
test.html
(browser)        (at start) -> (at end)

IE7               33252KB   -> 33240KB (   -12KB )
Firefox 2.0.0.9   27156KB   -> 27800KB (  +644KB )
Opera 9.24        27214KB   -> 27204KB (   -10KB )
Safari(wk r28220) 51452KB   -> 70800KB (+19348KB!)
---------------------------------------
test2.html
(browser)        (at start) -> (at end)

IE7               31564KB   -> 31884KB
Firefox 2.0.0.9   25348KB   -> 25812KB
Opera 9.24        26264KB   -> 26236KB
Safari(wk r28220) 49052KB   -> 49132KB
---------------------------------------
Comment 1 Mark Rowe (bdash) 2007-12-01 08:19:06 PST
I haven't been able to reproduce this in my tests.
Comment 2 David Kilzer (:ddkilzer) 2007-12-02 09:47:45 PST
(In reply to comment #1)
> I haven't been able to reproduce this in my tests.

Could it be a platform-only issue?  Did you test on Windows or Mac OS X?

Comment 3 Gavin Barraclough 2011-06-15 01:35:18 PDT
Cannot repro in ToT, closing.  Please reopen if you are still seeing this issue,

thanks,
G.