facebook / memlab

A framework for finding JavaScript memory leaks and analyzing heap snapshots
https://facebook.github.io/memlab/
MIT License
4.37k stars 119 forks source link

Can we get Snapshot with javascript file references #79

Closed rupesh1306 closed 1 year ago

rupesh1306 commented 1 year ago

Hi , Can we get snapshots with java script file references ? Actually I am successfully able to execute the scenario but not able to get java script file reference in that as shown in the screen shot. image

JacksonGL commented 1 year ago

Chrome DevTools is able to provide the code link as it utilizes the scriptId number associated with each heap snapshot's closure instance. This scriptId serves as a reference for the JavaScript source code that is loaded into Chrome's memory, enabling DevTools to access and query the source code using this key. However, Chrome does not serialize the mapping information tied to the scriptId to disk. As a result, MemLab is unable to retrieve the mapping data related to scriptId for now.

Maybe Chrome DevTools protocol can provide an interface for querying script based on scriptId.