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
{{ message }}
Repository navigation
Memory leak in setInterval + console.log + process.memoryUsage #2073
The following code exhibits a growth in RSS and heap over time:
The graphs look normal for v8 I think. v8 like to keep as much as it can (within a specified limit, default 1gb iirc) so it doesn't have to re-allocate, is my understanding.
1.5GB for x64 machines, but @Fishrock123 is correct. V8 feels free to use the heap it's given as freely as it wants. My experience is you can only know it's a memory leak for sure if it can cause the process to crash.
Activity
JacksonTian commentedon Jun 29, 2015
process.stdout.write buffered a lot data. Not really memory leak. You can write the data into file instead of.
bnoordhuis commentedon Jun 29, 2015
It's not necessarily indicative of a memory leak. What happens when you restrict the heap size with
--max_old_space_size=32?EricTheOne commentedon Jun 29, 2015
@JacksonTian since I see the measurements as they come on the console, doesn't it mean the buffer gets periodically flushed?
@bnoordhuis checking
Fishrock123 commentedon Jun 29, 2015
The graphs look normal for v8 I think. v8 like to keep as much as it can (within a specified limit, default 1gb iirc) so it doesn't have to re-allocate, is my understanding.
trevnorris commentedon Jun 29, 2015
1.5GB for x64 machines, but @Fishrock123 is correct. V8 feels free to use the heap it's given as freely as it wants. My experience is you can only know it's a memory leak for sure if it can cause the process to crash.
EricTheOne commentedon Jun 30, 2015
@bnoordhuis running with --max_old_space_size=32:
@trevnorris's comment means that looking at the growth in heap utilization is not enough, so I guess this behavior is normal.
Fishrock123 commentedon Jun 30, 2015
Yeah, seems normal, that's just how newer v8 does things. Closing.