axemclion / jquery-indexeddb

An IndexedDB Plugin for Jquery.
Other
195 stars 71 forks source link

Connection is not close and it is causing Memory leak #74

Open dipakprajapati91 opened 4 years ago

dipakprajapati91 commented 4 years ago

We are opening the connection on _$.indexedDB(INDEXEDDBDATABASENAME) but we are not closing it after operation is successfully completed or we do not have method exposed to close connection. Connection is only get closed when "onversionchange" event occur.

This way connection is always opened and causing memory leak. To reproduce this I have tried on "http://nparashuram.com/jquery-indexeddb/example/index.html" to move (3)product to cart and again back to catalog. It is leaking around 38KB for connection and 60KB for closure(onversionchange).

I am attaching the memory heap snapsort and the changed indexedDB library.

image

Existing Library : image

New Implementation : image

I am attaching the zip file of new source code if its look good to you please update the library. jquery.indexeddb.js.zip