Luuka / GPXParser.js

GPX file parser javascript library
http://luuka.github.io/GPXParser.js/
MIT License
116 stars 52 forks source link

out of memory error for large gpx files #19

Closed noerw closed 3 years ago

noerw commented 3 years ago

I get an OOM error for large GPX files such as this file:

<--- Last few GCs --->                                                                                                                                                        

[1156890:0x2c652c0]    20141 ms: Scavenge 2045.8 (2050.3) -> 2045.3 (2050.8) MB, 6.8 / 0.0 ms  (average mu = 0.171, current mu = 0.124) allocation failure                    
[1156890:0x2c652c0]    20951 ms: Mark-sweep 2046.1 (2050.8) -> 2045.8 (2050.6) MB, 753.2 / 0.0 ms  (+ 375.5 ms in 82 steps since start of marking, biggest step 6.9 ms, wallti
me since start of marking 1187 ms) (average mu = 0.111, current mu = 0.067) alloc                                                                                             

<--- JS stacktrace --->                                                                                                                                                       

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

    0: ExitFrame [pc: 0x13a71b9]                                                                                                                                              
Security context: 0x392cf3d008d1 <JSObject>                                                                                                                                   
    1: _insert [0x1ec8cbde5641] [/home/norwin/src/simport-learning/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js:~650] [pc=0x1ccf35dba52b](this=0x0bb206537eb1 <Event
TargetImpl map = 0x1f9f3cdbe5a9>,0x0d633dc41421 <EventTargetImpl map = 0x1f9f3cdbe5a9>,0x2f4bba1401b9 <null>,0x2f4bba1404b1 <undefined>)                                      
    2: /* anonymous */ [0x2c20650752c1] [/home/norwin/...                                                                                                                     

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

Writing Node.js report to file: report.20201110.202603.1156890.0.001.json                                                                                                     
Node.js report completed                                                                                                                                                      
 1: 0x9ef190 node::Abort() [node]                                                                                                                                             
 2: 0x9f13b2 node::OnFatalError(char const*, char const*) [node]                                                                                                              
 3: 0xb5da9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]                                                                                    
 4: 0xb5de19 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]                                                                      
 5: 0xd0a765  [node]                                                                                                                                                          
 6: 0xd0adf6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]                                                                                       
 7: 0xd1760a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]                                                         
 8: 0xd18515 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]                             
 9: 0xd1afcc v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]      
10: 0xce19bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]                                           
11: 0x10246ce v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]                                                             
12: 0x13a71b9  [node]                                                                                                                                                         
[1]    1156890 abort (core dumped)

My RAM was not full at that point, so maybe node sets a memory limit?