Comment #29 on issue 16821 by [email protected]: Memory leak
http://code.google.com/p/chromium/issues/detail?id=16821

Here's another test case derived from bug 12666.  Safari 4 runs out of  
memory and dies on this case at about the same rate
that Chrome 4 does.  Firefox 3.5 seems to be able to collect the nodes  
before crashing with this test, but if I increase
the rate of leakage (by adjusting the size of largeString) then the peak  
memory does go higher until it eventually runs out
of address space and dies.

In the test case there's a DOM structure like this:

<div>
   <div id='ticker'>
     <div style='display: none'>aaaaaaaaaaa.......</div>
   </div>
</div>

The length of the 'aaaaa' string is 2^18 characters and since WebCore uses  
2-byte characters it will use about 512KB of
memory.  There is a repeating timer that fires every 15ms that grabs a  
reference to 'ticker' and then resets its parent's
innerHTML field to create new nodes.  Since V8 has handles to the  
id='ticker' node it cannot be deallocated even though it
is no longer in the DOM.  This case is obviously a bit extreme but it  
illustrates the point.

Attachments:
        tick_test.html  534 bytes

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to