Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak problem #36

Open
mef opened this issue Apr 3, 2014 · 0 comments
Open

memory leak problem #36

mef opened this issue Apr 3, 2014 · 0 comments

Comments

@mef
Copy link
Contributor

mef commented Apr 3, 2014

There seems to be a memory leak problem on tuiter's REST API methods.

example code to reproduce the issue:

var cnt = -1;

makeRequest()

function makeRequest() {
// 1. perform a request to the tuiter API
// 2. re-attempt after a short delay
// 3. log rss memory usage every 50 requests
    cnt++

    tu.showUser({screen_name:'jack' }, function(err, data){
        if (err) console.log('error', err, data)
        if (cnt % 50 == 0) {
            // display rss memory usage
            console.log(process.memoryUsage().rss)
        }
        var t = setTimeout(function() {
            // re-run the request after a short delay
                makeRequest()
        }
        , 50)
        t = null
        data = null
        err = null
    })

}

The log will show that the memory usage is constantly increasing. Am I doing something wrong?

Could this be related to ladjs/superagent#152 or to ladjs/superagent#193

Any known workaround or fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant