There may be a memory leak
See original GitHub issueWhat you are doing?
// code here
What do you expect to happen?
Recycle memory
What is actually happening?
Executed (24ea0587-4836-4ebe-b693-f73c931fa86d): START TRANSACTION;
<--- Last few GCs --->
33650985 ms: Mark-sweep 1313.0 (1403.6) -> 1312.6 (1404.6) MB, 1348.9 / 0.0 ms [allocation failure] [GC in old space requested].
33652499 ms: Mark-sweep 1312.6 (1404.6) -> 1312.6 (1404.6) MB, 1427.7 / 0.0 ms [allocation failure] [GC in old space requested].
33653995 ms: Mark-sweep 1312.6 (1404.6) -> 1316.6 (1403.6) MB, 1495.3 / 0.0 ms [last resort gc].
33655483 ms: Mark-sweep 1316.6 (1403.6) -> 1320.7 (1403.6) MB, 1488.3 / 0.0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x3d6955fcfb39 <JS Object>
2: select [/home/axetroy/gpm/github.com/axetroy/duomi-nodejs/node_modules/sequelize/lib/query-interface.js:~666] [pc=0x20d2722ece6e] (this=0x1455d4775e51 <a QueryInterface with map 0x12e141fcfc11>,model=0x8f39e5ba859 <JS Function model (SharedFunctionInfo 0x34ad626ecb51)>,tableName=0x2092c9718069 <String[6]: trades>,options=0xda400df1619 <an Object with map 0x7aefbdd3d61>)
3: /* anonymo...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
2: 0x109bf8c [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
3: v8::Utils::ReportApiFailure(char const*, char const*) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
5: v8::internal::Factory::NewCode(v8::internal::CodeDesc const&, unsigned int, v8::internal::Handle<v8::internal::Object>, bool, bool, int, bool) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
6: v8::internal::CodeGenerator::MakeCodeEpilogue(v8::internal::MacroAssembler*, v8::internal::CompilationInfo*) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
7: v8::internal::FullCodeGenerator::MakeCode(v8::internal::CompilationInfo*) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
8: 0xb4c51e [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
9: 0xb4e900 [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
10: 0xb55fc6 [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
11: v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
12: v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*) [/home/axetroy/.nvm/versions/node/v6.11.0/bin/node]
13: 0x20d270b092a7
Aborted (core dumped)
Dialect: postgres Database version: 9.4 Sequelize version: 4.8.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >How do I check for memory leaks, and what should I do to stop ...
Tracking down a memory leak can be a difficult process. Let's say a program runs for a brief amount of time and has...
Read more >What Is a Memory Leak and How Do They Happen?
A memory leak is one of the major causes of the slowing down of a computer. It can be dangerous and lead to...
Read more >Memory leaks in Windows 10/11 - Stellar Data Recovery
System low on memory? It could be a memory leak! Read this guide to know what it is and how to avoid memory...
Read more >How To Detect and Prevent Memory Leaks | Scout APM Blog
Multiple references: When the same object is referenced from multiple objects, it might lead to a memory leak when one of the references...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also seeing this while doing a bunch of inserts/reads at the same time (1.7K/min)
Node 8.9, latest sequelize.
Looks like to parse the result from PG it is creating a function - basically it makes so many that never get cleaned up and eventually runs the process out of memory.
I’m pretty sure the function from this stack is https://github.com/brianc/node-postgres/blob/884e21e1ca58b7045c94d8cef4941eb97ac50ed5/lib/result.js#L55 based on searching, but can’t be 100%.
Had a similar problem but found that it was due to not having running the transactions in an async manner