You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a nodejs application that transforms images. I run my application with 32gb of ram. When trying to get the image data of a large image with more or less has a width of 20k and height of 20k I am getting this error. I have tried to increase the node js memory limit using --max-old-space-size tried to increase it to 8192 as well as 32678 but it I still get an error.
m[9161:0x41069d0] 18179 ms: Mark-sweep 22.3 (29.2) -> 22.0 (25.2) MB, 23.0 / 0.0 ms (+ 1.5 ms in 5 steps since start of marking, biggest step 0.8 ms, walltime since start of marking 55 ms) (average mu = 0.998, current mu = 0.963) finalize incremental m[9161:0x41069d0] 27013 ms: Mark-sweep 23.2 (25.2) -> 22.2 (25.2) MB, 3.8 / 0.0 ms (+ 0.1 ms in 2 steps since start of marking, biggest step 0.1 ms, walltime since start of marking 168 ms) (average mu = 0.999, current mu = 1.000) finalize incremental m
ArrayBuffers are allocated off of the heap, so setting --max-old-space-size will have no impact. (Try node --max-old-space-size=50 -e "new Uint8Array(550000000).fill(1)" to see for yourself.) Are you calling getImageData in a loop? If so, there's like something retaining those buffers causing a leak.
I have a nodejs application that transforms images. I run my application with 32gb of ram. When trying to get the image data of a large image with more or less has a width of 20k and height of 20k I am getting this error. I have tried to increase the node js memory limit using --max-old-space-size tried to increase it to 8192 as well as 32678 but it I still get an error.
m[9161:0x41069d0] 18179 ms: Mark-sweep 22.3 (29.2) -> 22.0 (25.2) MB, 23.0 / 0.0 ms (+ 1.5 ms in 5 steps since start of marking, biggest step 0.8 ms, walltime since start of marking 55 ms) (average mu = 0.998, current mu = 0.963) finalize incremental m[9161:0x41069d0] 27013 ms: Mark-sweep 23.2 (25.2) -> 22.2 (25.2) MB, 3.8 / 0.0 ms (+ 0.1 ms in 2 steps since start of marking, biggest step 0.1 ms, walltime since start of marking 168 ms) (average mu = 0.999, current mu = 1.000) finalize incremental m
`<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x21639e1c08d1
0: builtin exit frame: getImageData(this=0x0529133cc801 ,32150,22958,0,0,0x0529133cc801 )
FATAL ERROR: v8::ArrayBuffer::New Allocation failed - process out of memory
1: 0xa09830 node::Abort() [node]
2: 0xa09c55 node::OnFatalError(char const*, char const*) [node]
3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xb7db7b [node]
6: 0xb9b93e [node]
7: 0x7f7f87de455f Context2d::GetImageData(Nan::FunctionCallbackInfov8::Value const&) [/var/apps/print-export-worker/node_modules/canvas/build/Release/canvas.node]
8: 0x7f7f87dd91f9 [/var/apps/print-export-worker/node_modules/canvas/build/Release/canvas.node]
9: 0xbe96a9 [node]
10: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x13c5c79 [node]
Aborted`
I think that it's the limit of V8 to store an array bigger than its limit but how do I fix this problem.
The text was updated successfully, but these errors were encountered: