-
Notifications
You must be signed in to change notification settings - Fork 2k
Memory leak - detached dom tree #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
At what magnitude does the leak affect you? How much is actually "leaking"? This isn't so much a leak as it is keeping DOM trees in memory by design so that they can be restored. You can experiment with applying the aforementioned patch and storing them as strings, of course. You can set But I'm open to explore alternative caching strategies that are more efficient. |
It was affecting me pretty badly. On each page load I hade around 5000 entries added, so on the chrome timeline, my memory Nodes count was exploding very quickly. With the .html() way of caching, I was able to reduce that to 400 entries (not due to pjax but to some closure on a scroll event). It is kind of hard to benchmark the impact, I tried to monitor the ram increase in the chrome task manager, it looks like it helped a bit but could not say precisely how much, I could still try to investigate a bit more if it may helps. |
Please let us know when you find some absolute values. 5000 entries added might be a lot, or it might not be a lot if every entry is 1 byte. So, dealing with absolute values in megabytes is crucial to understanding just how severe the memory leak is. Also, please be aware that this is not a memory leak per se, but that pjax's internal cache is by design. If your pages are huge, you can disable the memory cache with |
Closing because some extra memory usage is expected with pjax due to its in-memory cache. This can be reduced with |
Hello,
I don't know if this bug is related to my code but I had a memory leak issue as you can see on the following image :
While looking for potential similar isuues, I stumble upon this "fixes" which solved my memory leak problem : #465 and related to #453
For the time being I will stick with this solution as the memory leak was really annoying and will let you know if using the html approach creates unwanted effects.
Let me know if you think about something to get rid of this problem using cloneContents.
The text was updated successfully, but these errors were encountered: