In Node.js you write one with v8.writeHeapSnapshot(). The file is JSON and can be as large as the heap itself, so delete it after use.