mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

memory leak using SlickGrid #1135

Open btfurukawatkr opened 7 years ago

btfurukawatkr commented 7 years ago

I seem to have encountered a memory leak issue while using the SlickGrid. I read the other Issues regarding a memory leak, but was not so sure if it was the same issue with me, so I decided to make a new Issue.

I have created a sample application to confirm this issue here

https://github.com/btfurukawatkr/slickgrid-sample

Here's what I did with the sample application.

  1. access to insert-and-delete-row.html
  2. create new row
  3. fill Title and %Complete
  4. repeate 2 and 3 for 4 times(add total 4 rows)
  5. delete the added rows from the old ones
  6. execute GarbageCollection
  7. repeate 2 to 6 for 20 times

I used

  1. windows7 Professional Service Pack 1
  2. Chrome-55.0.2883.75 m (64-bit)
  3. SlickGrid : v2.3.2
  4. jquery : v1.11.1
  5. jquery-ui: v1.11.1

This was the result. (the memory keeps on increasing)

ws000003

6pac commented 7 years ago

Will take me a little while to test, but I suspect that it's because you are binding a click event to the buttons. Elements with bound events are not removed from the DOM. Either (a) unbind the event before deleting the row in your code (b) move to a layout where you select rows and have a single 'delete' button outside the grid (c) use the AsyncRender cleanup function as per the examples

btfurukawatkr commented 7 years ago

Hi @6pac , Thanks for your quick response. I'll see if your suggestions work with my application.

6pac commented 7 years ago

Is this fixed?

btfurukawatkr commented 7 years ago

sorry @6pac , haven't got the time to check it yet...