How to release memory when reading images from buffers #406
Replies: 2 comments
|
Garbage collection is difficult in golang. govips can be pretty efficient and gobble more memory than the gc can release. https://tip.golang.org/doc/gc-guide You can adjust some gc parameters to make it more aggressive: You could also try putting the image processing parts into goroutines or even separate processes. |
0 replies
Sounds like your service is quite like us https://github.com/webp-sh/webp_server_go and https://webp.se 😃 Maybe you could try using
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am trying to build an API that can accept many http calls per second. For each of these, my service will stream down into memory an image taken from a URL, do some modifications on top of it and then serve it back (or currently just saving the image file).
I am trying to load test this service and I am noticing that the memory doesn't get released from GoVips and I am wondering if I am doing something wrong.
am I doing something visibly wrong or should I correctly expect the memory to be released properly by itself once the image is saved? The problem here is that most likely there is a go routine being spawned from every http call reaching the API.. I just don't know what happens next when it comes to GoVips
All reactions