Closed vigbk closed 9 years ago
I did a pull request with a fix. Let me know if there are any issues with that.
ugh, I haven't maintained this package (migrated everything to es6-native-map). There are certainly leaks in this version. I'll look at your PR and try to fix some other leaks (and probably make a node 0.12/iojs version).
Sure. That would be great. Thanks.
When I use the get or has function and then call clear, for some reason the keys are still getting retained. This is a sample code i used to test var heapdump = require('heapdump'); var Hashtable = require('hashtable'); function putItems() { var hashtable = new Hashtable(); for(var i =0;i<1000000;i++) { var phoneNumber = 1000000000 + i; var strPhoneNumber = "+01" + phoneNumber.toString(); var frequency = hashtable.has(strPhoneNumber); if(!frequency) { hashtable.put(strPhoneNumber,1); }
}
putItems();
When i comment out the has function then the memory gets completely released(The same if i replace has with get). I used node heap dump for debugging. Using node v0.12.4.