首页 > 解决方案 > TextDecoder iso-8859-1:Fatal javascript OOM in In Effective mark-compacts near heap limit

问题描述

我正在处理非常大的 CSV 文件(85Mo)。用 打开文件后Deno.readFile,我用 解码它new TextDecoder("iso-8859-1").decode(rawData);并得到以下错误:

注意:我没有使用 utf-8 得到这个错误

<--- Last few GCs --->

[17822:0x5400000000] 27318 ms: Mark-sweep (reduce) 1399.4 (1401.5) -> 1399.3 (1403.2) MB, 3173.1 / 0.0 ms (+ 0.1 ms in 431 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3424 ms) (average mu = 0.191, current mu = 0.[17822:0x5400000000] 30483 ms: Mark-sweep (reduce) 1399.8 (1401.7) -> 1399.5 (1402.5) MB, 3164.5 / 0.0 ms (average mu = 0.100, current mu = 0.000) allocation failure scavenge might not succeed

<--- JS stacktrace --->

#
# Fatal javascript OOM in Ineffective mark-compacts near heap limit
#
[1] 17822 illegal hardware instruction

Deno 版本:1.2.2

Mac 操作系统:10.14.6

内存:16 Gb

问题

使用编码解码文件时我做错了什么iso-8859-1

标签: javascriptdeno

解决方案


这似乎是一个错误

似乎是https://github.com/denoland/deno/blob/master/op_crates/web/08_text_encoding.js中 TextDecoder 实现中的一个错误

使用以下 v8 标志暂时绕过问题运行 deno:

--v8-flags=--max-old-space-size=8192

推荐阅读