facebook / memlab

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

How can I use script_id in IHeapLocation to get js url ? #118

Closed shimingw closed 6 months ago

shimingw commented 6 months ago

Is there any way I can get the js url of the specified node?

JacksonGL commented 6 months ago

I am not aware of a way to do this, unfortunately Chrome does not seem to expose such an API to query this information.

script_id is extracted from Chrome JS heap snapshot, it is just an index referring to a data structure in Chrome's memory when the heap snapshot was taken, but Chrome does not seem to encode and serialize the index-to-URL mapping in JS heap snapshot.

shimingw commented 6 months ago

Thank you for your reply