[gdal-dev] GDAL_CACHMAX on a docker container

Robert Coup robert.coup at koordinates.com
Wed May 23 03:53:45 PDT 2018


Hi,

On 23 May 2018 at 11:48, Even Rouault <even.rouault at spatialys.com> wrote:

>
> There are some hints to how this could be done:
> https://github.com/dotnet/coreclr/blob/master/src/gc/unix/cgroup.cpp
> https://stackoverflow.com/questions/42187085/check-mem-
> limit-within-a-docker-container
>
> I just tried
>
> $ docker run --memory 512m --rm -it ubuntu bash
>
> root at 0ae673d96789:/# cat /sys/fs/cgroup/memory/memory.limit_in_bytes
> 536870912
>
> Can you check in your docker container that
> cat /sys/fs/cgroup/memory/memory.limit_in_bytes
> returns the maximum memory amount you specified ?
>

Was just posting the same thing.

Yes, that approach works, and that's how the JVM does it now (
https://bugs.openjdk.java.net/browse/JDK-8170888), and others.

If there's no memory limit set you get (on 64-bit linux)
9223372036854771712, currently recommendation is to take the minimum of the
total system memory (eg. /proc/meminfo) and the cgroups
memory.limit_in_bytes

Rob :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180523/d63d3f77/attachment.html>


More information about the gdal-dev mailing list