Hi,

On 23 May 2018 at 11:48, Even Rouault <even.roua...@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@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 :)
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to