Is there anything like an event listener that I can add so I can execute a function whenever a GC occurs?
For example, if I simply wanted to log a line to the console on each GC, how can I do that?
I am fine with a Chrome-specific solution.
Is there anything like an event listener that I can add so I can execute a function whenever a GC occurs?
For example, if I simply wanted to log a line to the console on each GC, how can I do that?
I am fine with a Chrome-specific solution.
If you want to see what GC is doing over a period of time, you can use the Profile tool in Chrome as described here: How can I log what is being garbage collected in my javascript code?
It won't exactly put lines in your logs, but it might give you the info you need.