Skip to main content

Search and Top Navigation

#15249 new bug ()

Opened November 08, 2017 05:16AM UTC

Last modified May 05, 2018 08:28PM UTC

Autocomplete memory leak and CPU usage 100%

Reported by: speller Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:
Description

JQuery UI - 1.12.1

JQuery - 3.2.1

Steps to reproduce:

1. Go to official autocomplete combobox example: https://jqueryui.com/resources/demos/autocomplete/combobox.html

2. Save its source to local web server. Next edit page source and make number of LI elements 10x more (i.e. use copy-paste).

3. Run page.

4. Open and close the dropdown list 10 times.

Expected result:

Dropdown list opened and closed normally and fast.

What happen instead:

Every list open become slower and slower and after 10 openings it produce 100% CPU usege for 7 seconds (on my i5-3210M CPU)

As I can investigate the issue is that "this.bindings" array is doubled on every opening. And if you have an autocomplete with few hundred of elements (cities autocomplete list, for example) it become totaly unusable because of very large response lags.

This issue is not reproducable under jQuery 1.11.1 + jQueryUI 1.11.4

Proof: https://jsfiddle.net/wLw8mxo2/ (I used Chrome desktop browser and didn't tested under others)

If you will change jQuery to 1.9.1 and jQueryUI to 1.9.2 inthis fiddle the issue will disappear.

Attachments (0)
Change History (3)

Changed November 08, 2017 05:22AM UTC by speller comment:1

description: JQuery UI - 1.12.1 \ JQuery - 3.2.1 \ \ \ Steps to reproduce: \ 1. Go to official autocomplete combobox example: https://jqueryui.com/resources/demos/autocomplete/combobox.html \ 2. Save its source to local web server. Next edit page source and make number of LI elements 10x more (i.e. use copy-paste). \ 3. Run page. \ 4. Open and close the dropdown list 10 times. \ \ Expected result: \ Dropdown list opened and closed normally and fast. \ \ What happen instead: \ Every list open become slower and slower and after 10 openings it produce 100% CPU usege for 7 seconds (on my i5-3210M CPU) \ \ As I can investigate the issue is that "this.bindings" array is doubled on every opening. And if you have an autocomplete with few hundred of elements (cities autocomplete list, for example) it become totaly unusable because of very large response lags. \ \ This issue is not reproducable under jQuery 1.11.1 + jQueryUI 1.11.4JQuery UI - 1.12.1 \ JQuery - 3.2.1 \ \ \ Steps to reproduce: \ 1. Go to official autocomplete combobox example: https://jqueryui.com/resources/demos/autocomplete/combobox.html \ 2. Save its source to local web server. Next edit page source and make number of LI elements 10x more (i.e. use copy-paste). \ 3. Run page. \ 4. Open and close the dropdown list 10 times. \ \ Expected result: \ Dropdown list opened and closed normally and fast. \ \ What happen instead: \ Every list open become slower and slower and after 10 openings it produce 100% CPU usege for 7 seconds (on my i5-3210M CPU) \ \ As I can investigate the issue is that "this.bindings" array is doubled on every opening. And if you have an autocomplete with few hundred of elements (cities autocomplete list, for example) it become totaly unusable because of very large response lags. \ \ This issue is not reproducable under jQuery 1.11.1 + jQueryUI 1.11.4 \ \ Proof: https://jsfiddle.net/wLw8mxo2/ (I used Chrome desktop browser and didn't tested under others) \ If you will change jQuery to 1.9.1 and jQueryUI to 1.9.2 inthis fiddle the issue will disappear. \

Changed March 03, 2018 11:35PM UTC by mvlase comment:2

I think this can be considered duplicate of 10050

Changed May 05, 2018 08:21PM UTC by dmausner comment:3

_comment0: Performance issue still exists with JQ 3.3.1 and JQUI 1.12.1 used together. \ \ Question: code suggestion in #10050, where is that code to be inserted?1525552098600373

Performance issue still exists with JQ 3.3.1 and JQUI 1.12.1 used together.

This should be labeled a major priority, because the ui autocomplete feature is essentially _disabled_ in 1.12.1.

Question: code suggestion in #10050, where is that code to be inserted?