Skip to main content

Search and Top Navigation

#15095 closed bug (fixed)

Opened November 10, 2016 12:03PM UTC

Closed March 25, 2017 06:34AM UTC

Last modified June 14, 2017 02:40PM UTC

Autocomplete Combobox memory leak

Reported by: adamjimenez Owned by: scottgonzalez
Priority: minor Milestone: 1.12.2
Component: ui.autocomplete Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:
Description

There appears to be a memory leak with the autocomplete combobox.

I can recreate it by going to the combobox demo in Chrome (54):

https://jqueryui.com/autocomplete/#combobox

And then clicking the "show all items" button over and over.

After around 50 times it starts to noticably slow down, keep going and it eventually slows to a crawl.

This is more apparent in my real world app, which is often left open for a long time and can contain many more autocomplete items.

Attachments (0)
Change History (5)

Changed March 21, 2017 01:46PM UTC by rd3n comment:1

_comment0: I am facing the same problem with my own jQuery-UI widget based on the widget factory and using the autocomplete widget internally.[[BR]] \ But it is also reproducible with a simple test case (local source with 50 items and no filtering): \ - Tested on latest '''Chrome''' ('''57'''.0.2987.110) and '''Edge''' ('''38'''.14393.0.0) \ - Tested with latest '''jQuery''' ('''3.1.1''') and latest '''jQuery-UI''' ('''1.12.1''') \ - Reduced test case: http://codepen.io/rd3n/pen/MpVwLe \ - It takes about 10x more time for the suggestion list to be displayed after 30 openings on Chrome \ \ Additional notes: \ - '''Firefox''' ('''52'''.0.1) is not affected \ - '''jQuery-UI''' ('''1.12.0''') is also affected, but less importantly \ - '''jQuery-UI''' ('''1.11.4''') is not affected1490116138622227
_comment1: I am facing the same problem with my own jQuery-UI widget based on the widget factory and using the autocomplete widget internally.[[BR]] \ But it is also reproducible with a simple test case (local source with 50 items and no filtering): \ - Tested on latest '''Chrome''' ('''57'''.0.2987.110) and '''Edge''' ('''38'''.14393.0.0) \ - Tested with latest '''jQuery''' ('''3.1.1''') and latest '''jQuery-UI''' ('''1.12.1''') \ - Reduced test case: http://codepen.io/rd3n/pen/MpVwLe \ - It takes about 10x more time for the suggestion list to be displayed after 30 openings on Chrome \ \ Additional notes: \ - '''Firefox''' ('''52'''.0.1) is not affected \ - '''jQuery-UI''' ('''1.12.0''') is also affected, but less importantly \ - '''jQuery-UI''' ('''1.11.4''') is not affected \ \ '''Edit''': Seems to be related to other performance tickets already opened: \ - [https://bugs.jqueryui.com/ticket/15082 15082] \ - [https://bugs.jqueryui.com/ticket/15078 15078] \ - [https://bugs.jqueryui.com/ticket/15049 15049] \ - [https://bugs.jqueryui.com/ticket/15152 15152] \ - [https://bugs.jqueryui.com/ticket/15136 15136] \ - ...1490116757022570
_comment2: I am facing the same problem with my own jQuery-UI widget based on the widget factory and using the autocomplete widget internally.[[BR]] \ But it is also reproducible with a simple test case (local source with 50 items and no filtering): \ - Tested on latest '''Chrome''' ('''57'''.0.2987.110) and '''Edge''' ('''38'''.14393.0.0) \ - Tested with latest '''jQuery''' ('''3.1.1''') and latest '''jQuery-UI''' ('''1.12.1''') \ - Reduced test case: http://codepen.io/rd3n/pen/MpVwLe \ - It takes about 10x more time for the suggestion list to be displayed after 30 openings on Chrome \ \ Additional notes: \ - '''Firefox''' ('''52'''.0.1) is not affected \ - '''jQuery-UI''' ('''1.12.0''') is also affected, but less importantly \ - '''jQuery-UI''' ('''1.11.4''') is not affected \ \ '''Edit''': Seems to be related to other performance tickets already opened: \ - [https://bugs.jqueryui.com/ticket/15082 15082] \ - [https://bugs.jqueryui.com/ticket/15078 15078] \ - [https://bugs.jqueryui.com/ticket/15049 15049] \ - [https://bugs.jqueryui.com/ticket/15152 15152] \ - [https://bugs.jqueryui.com/ticket/15136 15136] \ - ... \ \ '''Edit 2''': The workaround as described by jGeek314 in [https://bugs.jqueryui.com/ticket/10050#comment:6 10050] : \ \ {{{ \ search: function(e,ui){ \ $(this).data('ui-autocomplete').menu.bindings = $(); \ }, \ }}} \ 1490117696731138

I am facing the same problem with my own jQuery-UI widget based on the widget factory and using the autocomplete widget internally.

But it is also reproducible with a simple test case (local source with 50 items and no filtering):

  • Tested on latest Chrome (57.0.2987.110) and Edge (38.14393.0.0)
  • Tested with latest jQuery (3.1.1) and latest jQuery-UI (1.12.1)
  • Reduced test case: http://codepen.io/rd3n/pen/MpVwLe
  • It takes about 10x more time for the suggestion list to be displayed after 30 openings on Chrome

Additional notes:

  • Firefox (52.0.1) is not affected
  • jQuery-UI (1.12.0) is also affected, but less importantly
  • jQuery-UI (1.11.4) is not affected

Edit: Seems to be related to other performance tickets already opened:

Edit 2: There is a workaround as described by jGeek314 in 10050 :

search: function(e,ui){
  $(this).data('ui-autocomplete').menu.bindings = $();
},

Changed March 25, 2017 06:34AM UTC by scottgonzalez comment:2

resolution: → duplicate
status: newclosed

Duplicate of #10050.

Changed April 19, 2017 04:54PM UTC by scottgonzalez comment:3

owner: → scottgonzalez
resolution: duplicatefixed

In [changeset:"ef2e9bab92ae898311baa295590cd487d9071319" ef2e9ba]:

#!CommitTicketReference repository="" revision="ef2e9bab92ae898311baa295590cd487d9071319"
Widget: Improve  event bindings for  options

Fixes #15078
Fixes #15082
Fixes #15095
Fixes #15136
Fixes #15152
Closes gh-1769

Changed April 19, 2017 04:55PM UTC by scottgonzalez comment:4

milestone: none1.12.2

Changed June 14, 2017 02:40PM UTC by scottgonzalez comment:5

#15205 is a duplicate of this ticket.