Node: V8 snapshot not executing

Created on 14 Mar 2020  路  2Comments  路  Source: nodejs/node

  • Version: v12.14.0
  • Platform: Windows 10
  • Subsystem: None

What steps will reproduce the bug?

index.js


    1. Run node index.js. Traces "Foo".


    1. Run node snapshot.json. This time does not trace "Foo".

const fs = require("fs")
    , path = require("path")
    , v8 = require("v8")

console.log("Foo")

fs.writeFileSync(path.resolve(__dirname, "snapshot.json"), v8.getHeapSnapshot().read())

How often does it reproduce? Is there a required condition?

No required condition.

What is the expected behavior?

Output:

$ node index.js
< Foo
$ node snapshot.json
< Foo

What do you see instead?

V8 heap snapshot does not execute.

question

Most helpful comment

@Hydroper A heap snapshot is not a runnable representation of a program, it鈥檚 basically just a list of all JS objects that exist in memory for debugging purposes.

V8 has another feature that鈥檚 called snapshot, but Node.js currently does not support snapshotting userland code (yet).

All 2 comments

@Hydroper A heap snapshot is not a runnable representation of a program, it鈥檚 basically just a list of all JS objects that exist in memory for debugging purposes.

V8 has another feature that鈥檚 called snapshot, but Node.js currently does not support snapshotting userland code (yet).

Closing as answered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willnwhite picture willnwhite  路  3Comments

cong88 picture cong88  路  3Comments

danielstaleiny picture danielstaleiny  路  3Comments

akdor1154 picture akdor1154  路  3Comments

loretoparisi picture loretoparisi  路  3Comments