views:

183

answers:

1

Hi,

I'm experiencing an increase of memory usage, when I use the jQuery-eventhandling in Chrome. I've tested it with IE and FF as well, but there I couldn't see a suspicious rise of memory-usage, compared to Chrome.

I'm using Chrome version 4.0.223.16 (unfortunately I'm forced to use this version, here)

Simple example here. Just scroll with the mousewheel in the red box and open the Chrome-taskmanager and you will see an increase of memory which won't be released anymore:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
<head>
<script type="text/javascript" src="js/libs/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
jQuery(function () {
    jQuery("#div1").bind("mousewheel", function (event) {
        event.preventDefault();
    });
});
</script>
</head>
<body>
<div id="div1" style="width: 100px; height: 100px; background-color: red;"></div>
</body>
</html>

Does anyone have experienced the same problem (or is it maybe solvend with a different version of chrome)? And does anyone have a fix for it?

thanks

+1  A: 

I can confirm this leaks some memory in chrome, even in the latest 5.0.356 developer build. However...I wouldn't worry about it. If you keep an eye on it, the garbage collector is cleaning it up about once every 60 seconds.

Nick Craver
If the garbage collector is picking it up, I'm not sure I would call it a memory leak.
Matt
@Matt - There are multiple levels/gens of garbage collection, one that runs every so often double checks for leaks on dependencies that level 1 may not pick up.
Nick Craver