n6g7/httpdf

Memory Leak

Closed this issue · 2 comments

The docker container crashes on me, with the node process being killed.

This happened while running v0.0.6 on AWS ECS using 256 MB of memory.

Also had a crash locally that looks to be related:

httpdf_1   | <--- Last few GCs --->
httpdf_1   |
httpdf_1   | [30:0x2d5fbd0]  1537877 ms: Mark-sweep 1380.5 (1425.7) -> 1379.7 (1426.2) MB, 615.3 / 0.1 ms  (average mu = 0.124, current mu = 0.031) allocation failure GC in old space requested
httpdf_1   | [30:0x2d5fbd0]  1538416 ms: Mark-sweep 1379.7 (1426.2) -> 1379.6 (1426.2) MB, 538.8 / 0.1 ms  (average mu = 0.068, current mu = 0.000) allocation failure GC in old space requested
httpdf_1   |
httpdf_1   |
httpdf_1   | <--- JS stacktrace --->
httpdf_1   |
httpdf_1   | ==== JS stack trace =========================================
httpdf_1   |
httpdf_1   |     0: ExitFrame [pc: 0x3562b61d7b01]
httpdf_1   | Security context: 0x1facac49e549 <JSObject>
httpdf_1   |     1: stringSlice(aka stringSlice) [0x3376dd2aab31] [buffer.js:~590] [pc=0x3562b61d7d3c](this=0x165b94c026f1 <undefined>,buf=0x07c8ad79c2c9 <Uint8Array map = 0x9c441b4ef99>,encoding=0x1facac4bb999 <String[4]: utf8>,start=0,end=331893)
httpdf_1   |     2: toString [0x24cb1d718c51] [buffer.js:~644] [pc=0x3562b5d458d7](this=0x07c8ad79c2c9 <Uint8Array map = 0x9c441b4ef99>,e...
httpdf_1   |
httpdf_1   |  1: 0x8c02c0 node::Abort() [node]
httpdf_1   |  2: 0x8c030c  [node]
httpdf_1   |  3: 0xad15de v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
httpdf_1   |  4: 0xad1814 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
httpdf_1   |  5: 0xebe752  [node]
httpdf_1   |  6: 0xebe858 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
httpdf_1   |  7: 0xeca982 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
httpdf_1   |  8: 0xecb2b4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
httpdf_1   |  9: 0xecc7aa v8::internal::Heap::CollectAllAvailableGarbage(v8::internal::GarbageCollectionReason) [node]
httpdf_1   | 10: 0xecdf8e v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
httpdf_1   | 11: 0xe962a5  [node]
httpdf_1   | 12: 0xe9dc0b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
httpdf_1   | 13: 0xe9e4e2 v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const>, v8::internal::PretenureFlag) [node]
httpdf_1   | 14: 0xadf329 v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [node]
httpdf_1   | 15: 0x96b970 node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [node]
httpdf_1   | 16: 0x8db334  [node]
httpdf_1   | 17: 0x3562b61d7b01
httpdf_1   | Aborted
httpdf_1   | error Command failed with exit code 134.
httpdf_1   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
httpdf_1 exited with code 1