Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

V0.6 mem leak #3256

Closed
wants to merge 1 commit into from
Closed

V0.6 mem leak #3256

wants to merge 1 commit into from

Conversation

Filirom1
Copy link

Hi
For me #3179 is not closed, but I was unable to reproduce my leak in test/gc.

Now I've created new failing test, could you check it please ?

node --expose-gc test/gc/test-http-client-timeout-not-expected.js
We should do 18 requests
Done: 5/18
Collected: 0/18
Force GC
Force GC
Done: 10/18
Collected: 0/18
Force GC
Force GC
Force GC
Force GC
Force GC
Done: 15/18
Collected: 0/18
Force GC
Force GC
Force GC
Done: 18/18
Collected: 6/18
Done: 18/18
Collected: 6/18
All should be collected now.

timers.js:96
            if (!process.listeners('uncaughtException').length) throw e;
                                                                      ^
AssertionError: false == true
    at Object.status [as _onTimeout] (/root/node/test/gc/test-http-client-timeout-not-expected.js:72:5)
    at Timer.ontimeout (timers.js:94:19)

Thank you

Romain

@isaacs
Copy link

isaacs commented May 11, 2012

This doesn't demonstrate that there's a leak. It only demonstrates that the gc doesn't always run unless you tell it to.

If you up the timer to 10000ms instead of 1, it'll be enough time for gc to do its work without prompting.

That's not to say there isn't still some memory leak issue, but it's not verified by this test.

@isaacs isaacs closed this May 11, 2012
@Filirom1
Copy link
Author

Yes you're right with the 10000ms instead of 1.

But I tried another thing: Filirom1@ad976fc
I call gc() every 100ms, and at the end I wait 10 more seconds for the GC to finish.

It is not always failing, but when it fails, it is unable to GC several request objects :

$ node --expose-gc test/gc/test-http-client-timeout-not-expected.js
We should do 18 requests
Done: 3/18
Collected: 0/18
Done: 16/18
Collected: 0/18
Done: 18/18
Collected: 0/18
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.
Called gc() 10  times since last time
Done: 18/18
Collected: 11/18
All should be collected now.

assert.js:104
  throw new assert.AssertionError({
        ^
AssertionError: false == true
    at Timer.<anonymous> (/home/romain/node/test/gc/test-http-client-timeout-not-expected.js:75:9)
    at Timer.ontimeout (timers.js:223:14)

I am sorry not to be able to do something more predictable.

But when it fails to GC, I can tell you that it stays in memory a long long time. Even when gc is called every 100ms during 10 minutes. When I use node-webkit-agent, I see the ClientRequest in the heap. Pictures are in #3179

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

Successfully merging this pull request may close these issues.

None yet

2 participants