Hacker News new | ask | show | jobs
by Y-bar 4079 days ago
Yes, removing elements from the DOM will allow browsers to free the memory.

Some site (Tumblr I think) did something like this a while ago where it would do something like this, it was very fluid:

1. When a new section has been appended to the bottom of the page…

2. Calculate the current height if the topmost div and save it explicitly as the div's height…

3. Then remove all content from that div.

4. And when another new section has been loaded and appended do the same thing, but with the second topmost and so on.