Skip to content

Is it possible to increase the memory of deno to use 2 arrays of 1 GB each? #10686

Discussion options

You must be logged in to vote

Hello, I found the solution:
--v8-flags=--max-old-space-size=8000

---- test.cmd ----
deno run --v8-flags=--max-old-space-size=8000 --unstable --allow-read --allow-write .\test.ts

--- test.ts ---
`let a1 : Uint8Array = new Uint8Array(1000 * 1000 * 1000)
let a2 : Uint8Array = new Uint8Array(1000 * 1000 * 1000)
let a3 : Uint8Array = new Uint8Array(1000 * 1000 * 1000)
let a4 : Uint8Array = new Uint8Array(1000 * 1000 * 1000)

for (let index = 0; index < a1.length; index++) {
a1[index] = index % 254
a2[index] = (index+1) % 254
a3[index] = (index+2) % 254
a4[index] = (index+3) % 254
}

await Deno.writeFile("a1.bin",a1)
await Deno.writeFile("a2.bin",a2)
await Deno.writeFile("a3.bin",a3)
await Deno.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by renaudfractale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant