Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#11125 closed bug (fixed)

Dialog: Memory leak when destroying widgets that wrap their elements

Reported by: stoychev Owned by:
Priority: minor Milestone: 1.11.4
Component: ui.dialog Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:

Description

Fiddle: http://jsfiddle.net/1odzx58L/

Happens with any widget that wraps its element. Use the Destroy & Recreate button to observe the memory increase after each click. Older jQuery UI versions seem to have the issue as well.

Change History (6)

comment:1 Changed 2 years ago by tj.vantoll

Component: ui.coreui.dialog
Status: newopen
Summary: Memory leak when destroying widgets that wrap their elementsDialog: Memory leak when destroying widgets that wrap their elements

I'm going to make this ticket dialog specific as there shouldn't be anything inherit to the widget factory itself that causes this (feel free to provide me wrong though). You can create additional tickets for other widgets you observe this behavior in.

I can confirm the memory usage goes up in your fiddle. I've found at least one cause of the increase: the ui-dialog-instances data() that dialog uses does not get cleaned up in destroy().

stoychev > The more specific details you can provide here the better, as tracking down these leaks can be tricky.

And thanks!

comment:2 Changed 2 years ago by tj.vantoll

Here's a PR for the instances one: https://github.com/jquery/jquery-ui/pull/1448. If you still have problems after this lands we can keep digging.

comment:3 Changed 2 years ago by TJ VanToll

Resolution: fixed
Status: openclosed

Dialog: Stop tracking instance in destroy() to avoid memory leaks

Fixes #11125 Closes gh-1448

Changeset: ec1f393c39aa5bbac1158acf692271f8ce9518ce

comment:4 Changed 2 years ago by Scott González

Milestone: none1.12.0

comment:5 Changed 2 years ago by TJ VanToll

Dialog: Stop tracking instance in destroy() to avoid memory leaks

Fixes #11125 Closes gh-1448 (cherry picked from commit ec1f393c39aa5bbac1158acf692271f8ce9518ce)

Changeset: 04ab6e0388f248b2490c2bc663528657ba39051a

comment:6 Changed 2 years ago by Scott González

Milestone: 1.12.01.11.4
Note: See TracTickets for help on using tickets.