Questions about memory usage #193
Replies: 1 comment 1 reply
-
@quentin-bettoum libvips (underlying library which vix uses) allocates memory separately which won't be tracked by the beam. So that is the reason for the discrepancies you are seeing, and that's why it won't be visible to the tools like libvips keeps a cache by default for better performance, that might be the reason for the memory usage you are seeing. Typically this won't be an issue. Can you check and confirm if you see any difference when you disable cache? You can do this by setting them to zero at the top of the script, before calling the operations. Vix.Vips.cache_set_max(0)
Vix.Vips.cache_set_max_files(0)
Vix.Vips.cache_set_max_mem(0) If you still see the issue then I'll debug with the script you shared as soon as I get some free time. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am bulding a webapp where I use Vips to thumbnail some uploaded images.
I noticed that when the images are being thumbnailed, the memory usage of the
beam.smp
process is growing significantly and never go down to original values.I could replicate the issue in a simple project: https://codeberg.org/quentin-bettoum/test_vix_memory
There is some discrepancy between what the OS reports and what is reported from Elixir using
:recon
or other tools.When thumbnailing images, the
beam.smp
process RAM usage grows from around 90M to somewhere between 200M and 300M, and it doesn't go down anymore after that (even when trying to manually garbage collect calling:erlang.garbage_collect()
).But when I use
:recon
or Phoenix Live Dashboard (in case of the web app) I can't see any memory usage spike as with system tools liketop
.Any help to understand what is happening would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions