Closed NickYuanyang closed 1 month ago
Sorry for the late response. You should have just one instance of the PdfTools and just call that multiple times. I have used this in production for many years, but that being said, I only run a handful of PDFs per day, it's possible there are some memory leaks that I'm not aware of. But definitely you need to start with a singleton.
I'd wager this is "normal memory greedy behavior for dotnet server processes". Try using DATAS in .net 8. I've seen dramatic reductions in memory usage so far.
https://maoni0.medium.com/dynamically-adapting-to-application-sizes-2d72fcb6f1ea
key line for csproj file:
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
In Docker, I use foreach, 10,000+ runs。Each PDF is about 79 + KB。The memory keeps getting bigger and bigger at any time, just filling up the memory。How to solve it? Are there any unmanaged objects that have not been released?