Once Safari has claimed memory from the operating system, it doesn't seem to give it back, even though it's no longer using it. Running the first test on the following page http://www.jakearchibald.co.uk/jsperformance/closurememory/1.html, this creates a 1mb string every second. http://www.flickr.com/photos/jaffathecake/3851167461/sizes/o/ Chrome (and other browsers) release the memory back to the operating system when the test is ended, whereas Safari keeps it, even if the tab is closed. Safari will reuse the memory it has reserved, but it doesn't give it back to the operating system, even if it has claimed 700mb+.
This is an issue in 526 (not tested the nightly builds) but the option wasn't available. Not sure which component this should be part of either.
Please test in a nightly build. The memory allocator used by Safari on Windows has been improved so that memory is returned to the OS at a more aggressive rate.
http://farm3.static.flickr.com/2554/3853034847_806c897794_o.png The above is the same test in a nightly build downloaded today. Although it starts releasing memory, it's not at a useful rate. In this test (and previous tests) one pixel on the graph == 1 second.
<rdar://problem/7165917>
*** Bug 22275 has been marked as a duplicate of this bug. ***
Created attachment 48950 [details] patch
Attachment 48950 [details] did not build on mac: Build output: http://webkit-commit-queue.appspot.com/results/278140
Attachment 48950 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 JavaScriptCore/wtf/FastMalloc.cpp:1501: TCMalloc_PageHeap::scavenge is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 1 If any of these errors are false positives, please file a bug against check-webkit-style.
Attachment 48950 [details] did not build on chromium: Build output: http://webkit-commit-queue.appspot.com/results/279134
Attachment 48950 [details] did not build on qt: Build output: http://webkit-commit-queue.appspot.com/results/279154
Attachment 48950 [details] did not build on gtk: Build output: http://webkit-commit-queue.appspot.com/results/280012
Comment on attachment 48950 [details] patch you have removed two #endifs but only one #if this would break stuff
Created attachment 48978 [details] patch Now with more buildy goodness.
Attachment 48978 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 JavaScriptCore/wtf/FastMalloc.cpp:1503: TCMalloc_PageHeap::scavenge is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 48978 [details] patch r=me
Fixed that edge case: Committed revision 54988. Still analyzing other causes. Clearing review flag.
Created attachment 50579 [details] patch Fixed a bug where the old code would release only one item from each size class per scavenge, potentially leaving large numbers of large-sized objects unreleased for a long time.
Attachment 50579 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 JavaScriptCore/wtf/FastMalloc.cpp:1385: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1386: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1387: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1387: min_free_committed_pages_since_last_scavenge_ is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/wtf/FastMalloc.cpp:1432: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1438: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1464: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1507: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1517: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1518: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:1525: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] JavaScriptCore/wtf/FastMalloc.cpp:2401: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 12 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Attachment 50579 [details] did not build on gtk: Build output: http://webkit-commit-queue.appspot.com/results/631033
Attachment 50579 [details] did not build on qt: Build output: http://webkit-commit-queue.appspot.com/results/664010
Committed revision 56028. Still analyzing other causes. Clearing review flag.