I scroll over an infinite scroll page using Puppeteer. As you can imagine, the memory grows and is never flushed. In order to lower the memory need, I decided to remove the loaded DOM every once in a while. While the browser is much faster to scroll, the memory remains the same.
I wanted to know how I can tell Puppeteer to flush its memory when the page is almost empty each time I remove the loaded DOM? Logically, the memory need should be extremely low. Maybe a garbage collection trigger would help? Anything I can do to release the memory?