1. Open DevTools on Chrome.
  2. Go to Memory tab.
  3. Select "Heap snapshot" profiling type.
  4. Click "Collect Garbage" (trash icon) and "Clear all profiles" (don't go icon).
  5. Take heap snapshot (record icon).
  6. Repeat multiple times:
    • click "Init editor",
    • wait to editor show up ,
    • click "Destroy editor".
  7. Record heap snapshot again.
  8. Compare Snapshot 1 with Snapshot 2 and look for:
    • "detached" - HTML Elements/DOM nodes
    • "EventListener" - there should be only 1
    • Any CKEditor5 classes instances like "Editor" or "LivePosition"

Notes:

Editor 1

This is an editor instance. And there's some link.

Editor 2

This is another editor instance.

Unlike Editor 1 it doesn't have contenteditable=true initially. Check if it's editable after initializing the editors and back to non-editable after destroying them.