You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your design pattern book is awesome. I am working with nodejs and need some advice on scenarios like below:
Lets say i have a function that makes persistent tcp connection to say twitter and does all the parsing on that.
Eg:
function addTwitter(somedata) {
var twit = new Twitter(somedata);
twit.on('twit', function(err,data) {
//do something here
// use somedata variable here.
}
}
addTwitter(somehandle);
addTwitter(anotherhandle);
so basically this addTwitter is used to make multiple connections to twitter server.
I am wondering if this style will leak memory. Also, If there is a better way of doing this.
The text was updated successfully, but these errors were encountered:
I actually think there would be huge value in adding a section on memory leak patterns. Good suggestion. I've recently given a talk on a similar subject - slides here: https://speakerdeck.com/addyosmani/javascript-memory-management-masterclass and might be able to extract some of this info into a chapter in the future.
Hi @addyosmani ,
Your design pattern book is awesome. I am working with nodejs and need some advice on scenarios like below:
Lets say i have a function that makes persistent tcp connection to say twitter and does all the parsing on that.
Eg:
so basically this addTwitter is used to make multiple connections to twitter server.
I am wondering if this style will leak memory. Also, If there is a better way of doing this.
The text was updated successfully, but these errors were encountered: