Closed ficapy closed 1 year ago
Considering your Close()
ing the image properly, that's an issue with Golang memory management. There's nothing we can do in the govips
library side to help you, unfortunately.
I suggest you check the golang garbage collector guide: https://tip.golang.org/doc/gc-guide
Here's another useful resource: https://concertio.com/blog/optimizing-the-go-garbage-collector-and-concurrency/
I seem to recall the latest golang versions provided some new control over the gc, in addition to the env variables mentioned in the above posts. I personally handled this by doing heavy image processing in separate goroutines, which are spawned and killed for each task as part of a pool.
I have written a long-running script that performs PNG to AVIF conversions during periods of low system load. However, I noticed that the memory used is not released after the task is stopped, with memory usage up to 500MB. Can anyone advise how to manually release the memory?