thlorenz / deoptigate

⏱️ Investigates v8/Node.js function deoptimizations.
https://nodesource.github.io/deoptigate-examples/xml2js/01_start/?selectedFileIdx=31&selectedLocation=157&includeAllSeverities=false&highlightCode=true&selectedTabIdx=1&selectedSummaryTabIdx=1
MIT License
1.16k stars 22 forks source link

Maximum size of isolate log file? #18

Closed pbadenski closed 3 years ago

pbadenski commented 3 years ago

Is there a maximum supported file size for isolate log file?

Getting this for an 800MB isolate-*-v8.log file:

node:buffer:592
    slice: (buf, start, end) => buf.utf8Slice(start, end),
                                    ^

Error: Cannot create a string longer than 0x1fffffe8 characters
    at Object.slice (node:buffer:592:37)
    at Buffer.toString (node:buffer:789:14)
    at Object.readFileSync (node:fs:421:41)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1110:18)
    at Module.load (node:internal/modules/cjs/loader:948:32)
    at Function.Module._load (node:internal/modules/cjs/loader:789:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_STRING_TOO_LONG'
}
thlorenz commented 3 years ago

Ah, well in this case it's the actual runtime that limits that. The only option to fix would be to not load the entire file, but parse it in a streaming manner. That would require a ton of changes, but I'm open to PRs :)

pbadenski commented 3 years ago

Fixed by #20; released in 0.6.0