无法在Node.js中创建~1.2GB Uint8Array

时间:2014-09-20 18:53:38

标签: javascript node.js memory v8

以下JavaScript代码:

new Uint8Array(1253377279)

使用node.js结果运行时:

RangeError: length > kMaxLength
    at repl:1:2
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
    at ReadStream.onkeypress (readline.js:99:10)
    at ReadStream.emit (events.js:98:17)
    at emitKey (readline.js:1095:12)

这很奇怪,考虑到我有8GB的ram,足以填满该阵列几次。我试过:--max-old-space-size=1900没有成功。我该怎么办?

0 个答案:

没有答案