Skip to content

memory leak in a loop. #18367

@manyuan

Description

@manyuan
  • Version:v6.10.0
  • Platform:linux x86_64 ubuntu 16.04
  • Subsystem:

code:

while(true){
console.log(new Buffer("asdfasdfas"))
}

when run a few minute,program exit with error:

<--- Last few GCs --->

267659 ms: Mark-sweep 1376.8 (1434.7) -> 1376.8 (1434.7) MB, 1661.6 / 0.0 ms [allocation failure] [GC in old space requested].
269309 ms: Mark-sweep 1376.8 (1434.7) -> 1376.8 (1434.7) MB, 1650.0 / 0.0 ms [allocation failure] [GC in old space requested].
270967 ms: Mark-sweep 1376.8 (1434.7) -> 1376.7 (1403.7) MB, 1657.7 / 0.0 ms [last resort gc].
272617 ms: Mark-sweep 1376.7 (1403.7) -> 1376.7 (1403.7) MB, 1649.9 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3378f3acfb51
1: nextTick [internal/process/next_tick.js:~134] [pc=0x36d27cb9206f] (this=0x2152b3c9b239 <a process with map 0x1594f1511671>,callback=0x87e0b825ac9 <JS Function afterWrite (SharedFunctionInfo 0x2152b3c52979)>)
2: arguments adaptor frame: 5->1
3: onwrite(aka onwrite) [_stream_writable.js:~356] [pc=0x36d27cb7c8dd] (this=0x3378f3a04381 ,stream=0x87e0b8435a1 <a WriteStream w...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x10983ec [node]
3: v8::Utils::ReportApiFailure(char const*, char const*) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
6: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
7: 0x36d27ca079a7

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleIssues and PRs related to the console subsystem.duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions