Option for identifying memory leak

52 views
Skip to first unread message

madana gopal

unread,
Mar 10, 2015, 1:53:38 PM3/10/15
to v8-u...@googlegroups.com
Please tell me any option that i can use to identify the place of memory leak in javascript execution.I am seeing continuous memory increase on clicking on jquery page/parsing JSON string.I want to identify/search the place in V8 code for that. It will be very helpful, if you can share any way to find the place of leak.Thanks.

Regards,
Madan

madana gopal

unread,
Mar 10, 2015, 11:06:33 PM3/10/15
to v8-u...@googlegroups.com
In a little bit detail, i am seeing the below strings coming inside RuntimeHidden_StringCharCodeAt() function.From uri.js it is seen that charCodeAt() is called from encode() function.

entry_id[0][align]
.........
entry_id[0][lastElementChild][align]
........
entry_id[0][lastElementChild][lastElementChild][align]

The above statements are coming when i user string->Print() inside RuntimeHidden_StringCharCodeAt(). Later these strings are flattened and memory is allocated. The memory allocation didn't seen to be decreasing. i.e when allocating flatten memory for "entry_id[0][lastElementChild][align]" looks not deallocating memory of "entry_id[0][align]". Could you please throw light on place, where i have to see, so that the memory allocated in NewRawOneByteString will get deallocated.Also, is this pattern is DOM string?.please clarify.

Regards,
Madan

Regards,
Madan


Ben Noordhuis

unread,
Mar 11, 2015, 8:03:39 AM3/11/15
to v8-u...@googlegroups.com
Are you using Chrome? Chrome DevTools has built-in functionality for
taking, inspecting and comparing heap snapshots.

If you are not using Chrome, you can programmatically create a heap
snapshot with v8::HeapProfiler::TakeHeapSnapshot() and write it to
disk with v8::HeapSnapshot::Serialize(). Make sure you give the file
a .heapsnapshot extension, or Chrome will refuse to load it.

If you need ready-to-paste example code, please see
https://github.com/bnoordhuis/node-heapdump :-)
Reply all
Reply to author
Forward
0 new messages