Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory consumption issue when processing images #469

Open
Kosadchiy opened this issue Mar 4, 2024 · 3 comments
Open

Memory consumption issue when processing images #469

Kosadchiy opened this issue Mar 4, 2024 · 3 comments

Comments

@Kosadchiy
Copy link

Hi,

Bug report
I faced with a problem that application crashes due to high memory consuming trying to resize multiple images when spawning goroutines. A docker container exits with code 139.
I spawn goroutine for each Image.Process method call. The problem does not reproduce in a single thread without goroutines.
Also I noticed that it depends on how many cache memory seted via VipsCacheSetMaxMem. If the value is 0 application crashes almost instantly while if I set VipsCacheSetMaxMem(1000) it process several images before error.

Environment
(please complete the following information)

  • OS: Alpine 3.14, Ubuntu 22.04
  • Vips: 8.15.1
  • bimg: 1.1.9

Additional context
Cant reproduce it on MacOS. The problem exists in Alpine or Ubuntu based docker containers.

Please let me know what other information I can provide.

Thanks!

@luhuaei
Copy link

luhuaei commented Mar 11, 2024

I have the same issue. I doubt it is caused by CGO in goroutines memory isn't being freed.

@Winens
Copy link

Winens commented May 3, 2024

Im not sure but, once i watched a video about what happends when goroutines are in low memory. It causes the app to crash. Maybe the issue here is not about CGO at all? How much memory did u even give? Looks like its not enough memory.

@Winens
Copy link

Winens commented May 3, 2024

Also you said you give VipsCacheSetMaxMem, but did you give that much memory to the docker container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants