Skip to content
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

Massive memory leak when deleting records #725

Closed
williamhaley opened this issue Oct 10, 2017 · 2 comments
Closed

Massive memory leak when deleting records #725

williamhaley opened this issue Oct 10, 2017 · 2 comments

Comments

@williamhaley
Copy link

williamhaley commented Oct 10, 2017

If I have the "Data" tab open in Ember Inspector when deleting a record, I see a massive memory leak in Chrome and the record never actually deletes. The page locks up. Memory usage gradually skyrockets until my machine becomes unusable. If Ember Inspector is closed when I delete a record, the issue does not occur, the record deletes, and everything works without issue.

I saw this issue on a real project of mine, but I figured it was because of something wrong that I was doing so I resigned myself to not being able to using Ember Inspector because of my own mistake.

But then I found I was able to recreate the issue with the super rentals demo app.

My demo app is pretty much identical to super rentals except for the ability to "delete" records.

  1. Clone my fork of super-rentals
  2. ember s
  3. Open Ember Inspector in Chrome
  4. Open whatever monitor you would use to view memory usage (e.g. Activity Monitor on macOS)
  5. Navigate to /rentals
  6. Open the "Data" tab on Ember Inspector
  7. Click "Delete" on one of the rentals in Chrome
  8. Watch Chrome memory usage skyrocket and the page lock up.
  9. Kill the tab, and the memory usage subsides.

No errors are thrown in the console, but the record doesn't delete. Notice the "pointer" mouse cursor. The page totally locks up. Everything works fine if Ember Inspector's "Data" tab is not open when I delete the record.

memory leak

I can easily repeat this bug both with super rentals and my real large-scale app.

Technically, I am not deleting the record in the demo I posted above. I am unloading the record from the store.

 this.get('store').unloadRecord(rental);

However, I see the same issue with my real app if I do an actual delete

someRecord.deleteRecord();
someRecord.save().then((res) => {
    //
});

I was hoping to use Ember Inspector to diagnose an unrelated issue I'm seeing with record deletes, but unfortunately, I cannot. Please let me know if I can do anything to help with this, or to help with Ember Inspector in general.

Version 61.0.3163.100 (Official Build) (64-bit)
macOS 10.12.6 (16G29)
Ember Inspector 2.1.1
@teddyzeenny
Copy link
Contributor

@williamhaley thank you for the detailed bug report! I believe this is the same issue addressed in emberjs/ember.js#15604. Can you try upgrading to Ember >= 2.15.2 and let me know if it's resolved?

@williamhaley
Copy link
Author

@teddyzeenny Thanks! I upgraded to ember-source 2.15.2 from 2.15.0 and voila, it's working. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants