Pascal

Pascal

Memory Leak Hunter

Memory leaks can be tricky to detect in JavaScript, particularly in detached windows.

Identify memory leaks using heap snapshots from chrome dev tools for example. Additionally, use Heap Cleaner to highlight specific nodes.

Some ways to mitigate memory leaks:

  • listen to the pagehide event to remove the reference to a modal window for example.
  • use postmessage which reduces the number of references between objects.
  • use WeakRef.