node - invalid array length

后端 未结 2 1775
抹茶落季
抹茶落季 2020-12-10 10:31

I\'m using node v0.12.4. When I run the following code with node --max-old-space-size=8192 test.js it gives me the error FATAL ERROR: invalid array length

相关标签:
2条回答
  • 2020-12-10 10:56

    V8's heap size is limited to 1 GB for 64 bit and 512 for 32-bit machine, but Buffer objects exist largely outside the heap. you can expand the memory use up to 1.7 GB in 64-bit and ~1 GB in 32-bit machine. You can try this.

    --max-old-space-size=3000  --trace-gc-verbose
    

    you can print the trace to know about the memory use.

    0 讨论(0)
  • 2020-12-10 11:15

    There is a limit of memory.64bit Machines can use about 1.6gb.This is the limit of V8 compiler. this links maybe can help you

    Configuring v8's memory management to be smart for a node.js process

    https://groups.google.com/forum/#!topic/nodejs/BQ5dSm8lITQ

    0 讨论(0)
提交回复
热议问题