So I was debugging a large binary memory usage in my application. Using :recon I found that two geolix processes were holding onto large binary references. I'm using the MMDB2 adapter. Before these changes, my BEAM instance was using ~800MB of memory.
After modifying the loader processes to hibernate and trigger a garbage collection, the memory usage went down to ~270MB.
This is the snippet using recon to find processes holding onto binaries:
The geolix loader (in this case 0.766.0) was holding onto ~530MB of binaries while the mmdb2 loader was holding onto ~234MB.
There is a similar PR for the mmdb2 adapter. If you know the proper places where the mmdb2 adapter creates the binary references, another fix would be to call :binary.copy there instead. I don't think that hibernating here has any bad consequences though.
@mneudert This would be really useful for us, is there anything I could help with to potentially get this and the corresponding PR in the mmdb2 adapter merged?
So I was debugging a large binary memory usage in my application. Using
:recon
I found that two geolix processes were holding onto large binary references. I'm using the MMDB2 adapter. Before these changes, my BEAM instance was using ~800MB of memory. After modifying the loader processes to hibernate and trigger a garbage collection, the memory usage went down to ~270MB.This is the snippet using recon to find processes holding onto binaries:
Resulting in:
The geolix loader (in this case 0.766.0) was holding onto ~530MB of binaries while the mmdb2 loader was holding onto ~234MB.
There is a similar PR for the mmdb2 adapter. If you know the proper places where the mmdb2 adapter creates the binary references, another fix would be to call
:binary.copy
there instead. I don't think that hibernating here has any bad consequences though.