Leo4815162342 / dukascopy-node

✨ Download historical price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨
https://dukascopy-node.app
MIT License
365 stars 68 forks source link

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #96

Closed Ray-ane closed 2 years ago

Ray-ane commented 2 years ago

Hello,

When i run

npx dukascopy-cli -i eurusd -from 2022-01-01 -to 2022-10-14 -t tick -f csv

i got this error :

<--- Last few GCs --->

[79122:0x150008000] 1489505 ms: Scavenge 1832.0 (1899.2) -> 1826.9 (1899.0) MB, 9.5 / 0.0 ms (aver [79122:0x150008000] 1489577 ms: Scavenge 1841.2 (1899.4) -> 1835.4 (1899.2) MB, 8.9 / 0.0 ms (aver [79122:0x150008000] 1489618 ms: Scavenge 1849.1 (1900.2) -> 1843.3 (1904.0) MB, 7.2 / 0.0 ms (aver

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me 1: 0x104fa5c84 node::Abort() [/usr/local/bin/node] 2: 0x104fa5e74 node::ModifyCodeGenerationFromStrings(v8::Local, v8::Local, 3: 0x1050ea7d4 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/usr/local/b 4: 0x1050ea794 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) 5: 0x10526dcb0 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionR 6: 0x1052712c0 v8::internal::Heap::CollectSharedGarbage(v8::internal::GarbageCollectionReason) [/us 7: 0x10526e478 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCC 8: 0x10526bda0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::Garb 9: 0x10526ac08 v8::internal::Heap::HandleGCRequest() [/usr/local/bin/node] 10: 0x10521fdfc v8::internal::StackGuard::HandleInterrupts() [/usr/local/bin/node] 11: 0x105582318 v8::internal::Runtime_StackGuard(int, unsigned long, v8::internal::Isolate) [/usr/ 12: 0x10589600c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/nod 13: 0x109f66264 14: 0x109ed65a0 15: 0x109f6c4f4 16: 0x109ed927c 17: 0x109dec9c4 18: 0x109ed1440 19: 0x109ee3058 20: 0x109ed95dc 21: 0x1058b2468 Builtins_ArrayMap [/usr/local/bin/node] 22: 0x105829c98 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node] 23: 0x105829c98 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node] 24: 0x105859294 Builtins_AsyncFunctionAwaitResolveClosure [/usr/local/bin/node] 25: 0x1058de0f8 Builtins_PromiseFulfillReactionJob [/usr/local/bin/node] 26: 0x10584b674 Builtins_RunMicrotasks [/usr/local/bin/node] 27: 0x105827964 Builtins_JSRunMicrotasksEntry [/usr/local/bin/node] 28: 0x1051fa460 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate, v8::internal::(a 29: 0x1051fa894 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate, v8:: 30: 0x1051fa980 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate, v8::internal::Micr 31: 0x10521d5bc v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate) [/usr/local/bin/ 32: 0x10521de50 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate) [/usr/local/bin/node] 33: 0x104ef5c4c node::InternalCallbackScope::Close() [/usr/local/bin/node] 34: 0x104ef57c4 node::InternalCallbackScope::~InternalCallbackScope() [/usr/local/bin/node] 35: 0x104f514e8 node::Environment::RunTimers(uv_timer_s) [/usr/local/bin/node] 36: 0x105808b68 uv__run_timers [/usr/local/bin/node] 37: 0x10580bba8 uv_run [/usr/local/bin/node] 38: 0x104ef66d4 node::SpinEventLoop(node::Environment) [/usr/local/bin/node] 39: 0x104fdfa90 node::NodeMainInstance::Run(int, node::Environment*) [/usr/local/bin/node] 40: 0x104fdf770 node::NodeMainInstance::Run() [/usr/local/bin/node] 41: 0x104f79e38 node::Start(int, char**) [/usr/local/bin/node] 42: 0x109b69088 [1] 79121 abort npx dukascopy-cli -i eurusd -from 2022-01-01 -to 2022-10-14 -t tick -f csv

Ray-ane commented 2 years ago

I also tried to use : https://historical-market-data.vercel.app/ to download this data with same parameters the web app give me an error with no description

Leo4815162342 commented 2 years ago

We're working on implementing a more memory-efficient file saving solution, so stay tuned. ATM, I'd recommend querying for shorter time frames, especially when it comes to tick data

Leo4815162342 commented 2 years ago

@Ray-ane please update dukascopy-node to the latest version (1.26.0) - the issue should be fixed

Leo4815162342 commented 1 year ago

dukascopy-node@1.31.3 contains more performance improvements and addresses the memory leak issue

details > https://github.com/Leo4815162342/dukascopy-node/pull/119