<div dir="ltr"><div><div>I opened and issue:<a href="https://github.com/OSGeo/gdal/issues/640">https://github.com/OSGeo/gdal/issues/640</a><br><br></div><span class="gmail-im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Can you check in your docker container that<br>
cat /sys/fs/cgroup/memory/memory.l<wbr>imit_in_bytes<br>
returns the maximum memory amount you specified ?<br></blockquote><div><br></div></span></div>yes it returns the memory I specified <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 23, 2018 at 1:53 PM, Robert Coup <span dir="ltr"><<a href="mailto:robert.coup@koordinates.com" target="_blank">robert.coup@koordinates.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<span class=""><div><br></div><div>On 23 May 2018 at 11:48, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br></div></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-4629839498080253898gmail-HOEnZb"><div class="m_-4629839498080253898gmail-h5"><br></div></div>
There are some hints to how this could be done:<br>
<a href="https://github.com/dotnet/coreclr/blob/master/src/gc/unix/cgroup.cpp" rel="noreferrer" target="_blank">https://github.com/dotnet/core<wbr>clr/blob/master/src/gc/unix/<wbr>cgroup.cpp</a><br>
<a href="https://stackoverflow.com/questions/42187085/check-mem-limit-within-a-docker-container" rel="noreferrer" target="_blank">https://stackoverflow.com/ques<wbr>tions/42187085/check-mem-limit<wbr>-within-a-docker-container</a><br>
<br>
I just tried<br>
<br>
$ docker run --memory 512m --rm -it ubuntu bash<br>
<br>
root@0ae673d96789:/# cat /sys/fs/cgroup/memory/memory.l<wbr>imit_in_bytes<br>
536870912<br>
<br>
Can you check in your docker container that<br>
cat /sys/fs/cgroup/memory/memory.l<wbr>imit_in_bytes<br>
returns the maximum memory amount you specified ?<br></blockquote><div><br></div></span><div>Was just posting the same thing.</div><div><br></div><div>Yes, that approach works, and that's how the JVM does it now (<a href="https://bugs.openjdk.java.net/browse/JDK-8170888" target="_blank">https://bugs.openjdk.java.<wbr>net/browse/JDK-8170888</a>), and others.</div><div><br></div><div>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</div><div> </div><div>Rob :)</div></div>
</div></div>
<br>______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a><br></blockquote></div><br></div>