Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:01:18+00:00 2026-05-30T14:01:18+00:00

jQuery-selectable is causing memory leaks. How can I prevent this? Is there something I

  • 0

jQuery-selectable is causing memory leaks. How can I prevent this? Is there something I am missing?

I have a complex web app that uses multiple instances of jquery UI-selectable. I have been using sIEve to track memory leaks and I notice the number of leaks is equal to the number of ui-selectable instances.

I wrote a simple test page that uses selectable as minimally as I could think of. In sIEve, it caused 1 memory leak (div#b).

Here is the HTML:

<!DOCTYPE html>
<html>
<head><title>test leaks with selectable</title>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="testLeaks.js"></script>
</head>

<body>

<div id="b"></div>

</body>
</html>

And here is testleaks.js:

function begin() {
    $('#b').selectable();
}

function unloadCleanup() {
    $('#b').selectable('destroy');
    $('#b').remove();
}

$(window).unload(unloadCleanup);
$(document).ready(begin);

I only included unloadCleanup and the .unload handler after I already saw the leak. It makes no difference with or without it.

This seems to be evidence that simply activating jquery-selectable causes a memory leak.

Next I changed testleaks.html to include sub-divs:

<div id="b">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>

In sIEve, I loaded the page and selected one of the sub-divs. The number of resulting leaks was 11 – one for the selectable div itself, and one for each selectee.

Selecting more than one sub-div did not increase the number of leaks. The number of leaks was 11 if any sub-divs were selected, and 1 if no sub-divs were selected.

Using jQuery 1.6.4, and jQuery-UI 1.8.16 with selectable, dialog, and datepicker, and the lightness theme.

Is there something I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:01:20+00:00Added an answer on May 30, 2026 at 2:01 pm

    The cause was not selectable. It was apparently datepicker.

    Out of curiosity I updated to jQuery 1.7.1 and jQuery UI 1.8.18 with the same components (selectable, dialog, and datepicker). It still had the same issue with memory leaks.

    I tried the same version without datepicker, using only selectable and dialog, and the memory leaks disappeared.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid like this http://jqueryui.com/demos/selectable/#display-grid . How can I store a user
I have ASP.NET MVC application that has list with jQuery Selectable list. My problem
This might seem like an odd request but I'd like to use jQuery's Selectable
I am trying to have the functionality of the jQuery selectable list when using
I have a table with selectable cells (via jQuery-UI selectable). Cells are selected individually,
I need a jQuery calendar plugin where I can specify what dates are selectable
I've been reading about the Jquery UI selectable plugin, my question is: Can I
can anyone help me use the jquery ui selectable library to perform the following
I have embedded the fullcalendar jquery control by using this code: $(document).ready(function() { var
In my case,I have an UL with JQuery UI Selectable plugin applied,but at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.