I read an interesting Mozilla page about zombie compartments:
Basically it’s allocated JavaScript memory for pages that wasn’t released when the pages were closed. Apparently these zombie compartments can be caused by poorly written add-ons and userscripts. If you visit about:compartments and see compartments for sites you have closed, you have zombie compartments.
To solve this, you can start by open Firefox in safe mode and see if the problem persist. If it doesn’t, enable the add-ons one after another to pinpoint which one is causing the memory leak.