How to prevent memory leak when using Jquery - datatables (ie7)?

How to prevent memory leak when using Jquery - datatables (ie7)?

bbaranibbarani Posts: 32Questions: 0Answers: 0
edited February 2013 in DataTables 1.9
I am using datatables in my Javascript application but when rendering the DOM, memory of IE grows up like anything. Memory doesn't come down even after clearing the datatatables element from DOM.

I have multiple tabs and i remove the LI part of the DOM to remove the tab which host the datatable.

If I dont render the DOM via datatables, the utilized memory is very less..

[code]
var functionLoad=(function (datasource){
var oTable = $("#" + elementId).dataTable({})
});[/code]

Can someone let me know the best way to prevent memory leaks when using IE7?

Is there a way to remove reference of table element?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    > Memory doesn't come down even after clearing the datatatables element from DOM.

    Are you clearing them with fnDestroy? I'm not aware of any leaks at this time, so I'd need a test case showing the issue please.

    Allan
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    edited February 2013
    Hi,

    I have created a test case below....

    http://live.datatables.net/uhojoh/11

    Please click load data table to load the data table and note the memory consumption.. Click Destroy data table to remove the table.. The memory will still remain even after destroying the data table and removing the element from DOM..

    I have uploaded memory consumption in the below site for your reference,

    http://postimage.org/image/o8dfwjvqx/

    This issue comes up only when the column data has hyperlink in it.

    The below link has the same data except that the column data doesn't contain any hyperlink in them and there's no issue of memory leak here...

    http://live.datatables.net/uhojoh/12


    Thanks,
    Barani
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Thanks for the test case. I don't immediately understand why it is not working, but I've bookmarked this discussion to look into it when I've got a bit of time to investigate in depth.

    Allan
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Allan, any updates on this issue?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Sorry. I haven't had a chance to look at this yet. I will try to make time next week.

    Allan
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Sorry to bug you :)... Just thought of checking if you have any updates on this issue?
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Allan.. any updates on this issue? Am I doing anything wrong in terms of loading the data to datatables?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    No sorry - I need a clear hour or two to sit down and try to work out what is going wrong and haven't had that chance yet. What you are doing looks like it should work okay. I will try to look at it soon.

    Allan
  • pratikchatpratikchat Posts: 1Questions: 0Answers: 0
    Hi Allan,

    I am seeing the exact same memory leak on Internet Explorer 9. Please let us know when we have a fix for this.

    Thanks
    Pratik
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Allan, sorry to bother you....any updates :) ?
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Allan, any updates on this issue?
This discussion has been closed.