history.js icon indicating copy to clipboard operation
history.js copied to clipboard

Memory Leak

Open AaronLayton opened this issue 10 years ago • 3 comments

I am noticing there is a memory leak when using this in Chrome Version 32.0.1700.76 m. This may be happening with other browsers aswell.

There is a timer running once every second and not being recycled. The script is pointing to this point

/**
 * Bind for Saving Store
*/
if ( sessionStorage ) {
    // When the page is closed
    History.onUnload = function(){

any ideas?

AaronLayton avatar Jan 27 '14 14:01 AaronLayton

I found this post b/c i discovered the same thing on my site when using this library.

Chrome 34.0.1847.116 m

image

IE 11.00.9600.16428

image

Worst part about this, is that its spiking so many of my CPU's cores, its affecting other programs on my computer, just in the slightest, but thats still unacceptable in my opinion.

Th3Mafia avatar Apr 23 '14 18:04 Th3Mafia

This bug is occurring to me on all major versions of: Safari (7.0.5), FireFox (30.0), and Chrome (36.0.1985) for the jquery version.

chrisid avatar Jul 22 '14 15:07 chrisid

Just noticed this happening... Since it really is unacceptable, I figured out a possible solution.

In history.js or bundled file, find the line:

History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval));

replace it with:

History.isInternetExplorer() && History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval));

this uses the built-in History.js IE check. I'm not sure whether or not this breaks anything, but it seems to have solved my issue.

floticerus avatar Nov 08 '14 15:11 floticerus