Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory leak in jQuery UI Draggable with MeteorJS?
    primarykey
    data
    text
    <p>I think I've discovered a memory leak in the jQuery UI draggable library, although the problem might be being caused by Meteor, I'm not sure.</p> <p>I first noticed this when my app was first used by a group of users all day. I had the app open in a tab and by the end of the day it was so slow it was unusable. I checked the memory usage and noticed it was using almost an entire GB of memory.</p> <p>To recreate this issue I wrote a PhantomJS script that logs into the app and does a bunch of updates while record the memory usage in Chrome's dev tools. So I went hunting for what code was causing the issue, found out it was the draggable/droppable events I was putting on elements in the render event of my template.</p> <p>Here's an example of the memory usage while my phantom script runs with draggable: <img src="https://i.stack.imgur.com/Kp5OL.png" alt="enter image description here"></p> <p>and here is my memory usage without draggable: <img src="https://i.stack.imgur.com/cgq29.png" alt="enter image description here"></p> <p>NOTE: I tried draggable &amp; droppable together, as well as separately, with ZERO configuration options and found no noticeable changes in the leak.</p> <p>As you can tell from the first graph the memory usage isn't being released after the script stops running(around 1.4 min), and there is a pretty good increase in memory usage(14.3 MB to 169 MB). This is running around 300-500 updates(something that probably isn't all that unrealistic, especially over the course of an entire day with a lot of users).</p> <p>I think the key here is the node count that Chrome gives you in the timeline tab. After the script has ran there is 100 000+ DOM nodes according to the DOM Node Count, on the second there is around 1000.</p> <p>I created a completely independent project to ensure this issue was real. I've put this on github for anyone to play with. My phantomJS script is in the root directory.</p> <p><a href="https://github.com/davidworkman9/jQueryDraggableMemLeakWithMeteor" rel="nofollow noreferrer">https://github.com/davidworkman9/jQueryDraggableMemLeakWithMeteor</a></p> <p>I'm unsure of where to go from here, whether to Meteor or jQuery UI, or if the issue is solvable without a fix from either of those packages.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload