I'm having issues with Rotativa and wkhtmltopdf memory leaks/management. As you can see in the screenshot, the memory rise is when the PDFs are generated, every spike basically corresponds to single PDF being generated. Single document is roughly 30KB in size, so storing them in byte array shouldn't be a problem. But rest of the memory (unmanaged) is not being cleared out.
For smaller amount of files it's not a huge problem, but sometimes I have to generate 40-50 files and then the memory spikes to almost 2GB and doesn't free until I restart the API.
Is there any way to prevent that? Or is that library problem?
App is written in .NET Core 2.1 and Rotativa is in 1.1.1, so the newest one on nuget.