[Qgis-user] QGIS memory management in LXCs vs VMs

Julien Cabieces julien.cabieces at oslandia.com
Tue Jan 24 01:22:09 PST 2023


Hi,

I had a quite similar problem with a client running QGIS server inside
Docker container. The Docker where running out of memory and they were
OOM (Out-of-memory) killed, so it's not exactly what you described.

The trick was to configure properly the environment variable
GDAL_CACHEMAX :
https://trac.osgeo.org/gdal/wiki/ConfigOptions#GDAL_CACHEMAX

The document says that its default value is a percentage of the physical
RAM, so I don't know exactly how it behaves in a LXC/Docker container.

You can try to set a fixed value in megabytes, see if it changes
anything.

Hope it helps,

Regards,
Julien



> Hey there,
>
> This is admittedly a bit niche, but I thought I'd give it a shot. We're using QGIS inside Linux Containers (LXCs) to process aerial imagery, but
> are running up against what seem to be memory management problems. When we load in imagery from the filesystem and begin panning
> around the map, memory/swap consumption of course increases. However, when the system begins to run out of memory/swap, we see
> different behaviour in LXCs vs VMs. In the VM, QGIS seems to intelligently manage what data it has cached and continues to function as it
> hovers near memory limits, allowing us to keep panning and loading in new imagery. However, inside of LXCs QGIS will keep filling memory
> and never clearing anything until the system fully locks up and we have to kill QGIS or reboot the container. My initial suspicion is that it's
> assuming it has full system memory rather than the limited memory that is defined by cgroups, though this is a bit of a shot in the dark.
>
> We've tested and observed this behaviour in containers running both Ubuntu 20.04 with QGIS 3.16 as well as Ubuntu 22.10 with QGIS 3.28.
> Meanwhile, we have a Ubuntu 20.04/QGIS 3.16 VM that seems far more stable. 
>
> Any help (or even just a pointer as to where to look next) would be greatly appreciated!
>
> Best,
> David
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


-- 

Julien Cabieces
Senior Developer at Oslandia
julien.cabieces at oslandia.com
09.72.52.52.76


More information about the QGIS-User mailing list