Re: [go-nuts] Go memory usage inside containers

2018-09-13 Thread robert engels
I now have the time to give a longer explanation regarding GC, that anyone using Go might find interesting. There are some simplifications in the following, but they’re not significant. At any given moment, the memory use of a program = live objects + garbage + unused heap. When a mutator

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread robert engels
This may be of interest. https://lists.linuxfoundation.org/pipermail/containers/2012-May/029798.html https://www.spinics.net/lists/cgroups/msg16842.html

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Wojciech S. Czarnecki
On Tue, 11 Sep 2018 23:48:03 -0700 (PDT) Leigh McCulloch wrote: > Hi, > > Does anyone here know how Go interacts with memory limits inside > containers? (e.g. Kubernetes, Docker) Real box info - parse /proc/meminfo Inside Docker: use stats via socket. Mount /var/run/docker.sock into your

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Henrik Johansson
taskset works for sure and I managed to crash a program with ulimit. I thought these stuff was what the container runtimes used under the hood. Am I missing something? ons 12 sep. 2018 kl 16:14 skrev Ian Lance Taylor : > On Wed, Sep 12, 2018 at 7:07 AM, robert engels > wrote: > > With the Azul

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Ian Lance Taylor
On Wed, Sep 12, 2018 at 7:07 AM, robert engels wrote: > With the Azul VM (and I believe the G1 collector in Java), the VM is > definitely aware of memory pressure as it approaches the maximum limit - then > it will increase the concurrent GC activity trying to avoid a potential huge > pause if

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Ian Lance Taylor
On Wed, Sep 12, 2018 at 6:58 AM, Leigh McCulloch wrote: > > Thanks for the link and answering. I'll look more into understanding the > issue. I'm mostly trying to reconcile that there are so many articles about > not using Java inside containers because it does nothing to stay in the > memory

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread robert engels
You would need to refer me to those articles. We used Java in containers all of the time. You need to set a proper -Xmx though. > On Sep 12, 2018, at 9:07 AM, robert engels wrote: > > With the Azul VM (and I believe the G1 collector in Java), the VM is > definitely aware of memory pressure as

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread robert engels
With the Azul VM (and I believe the G1 collector in Java), the VM is definitely aware of memory pressure as it approaches the maximum limit - then it will increase the concurrent GC activity trying to avoid a potential huge pause if the limit was reached - so throughput is lowered. I would

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Leigh McCulloch
Hi Ian, Thanks for the link and answering. I'll look more into understanding the issue. I'm mostly trying to reconcile that there are so many articles about not using Java inside containers because it does nothing to stay in the memory limits, but then I see no other articles about Go, giving

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Ian Lance Taylor
On Tue, Sep 11, 2018 at 11:48 PM, Leigh McCulloch wrote: > > Does anyone here know how Go interacts with memory limits inside containers? > (e.g. Kubernetes, Docker) > > Does the Go runtime have similar problems as the Java runtime, in that it > doesn't know what the container limit is, and

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Henrik Johansson
Afaik it works fine for Go programs as long as these limits translates to things like taskset etc. ons 12 sep. 2018 kl 08:48 skrev Leigh McCulloch : > Hi, > > Does anyone here know how Go interacts with memory limits inside > containers? (e.g. Kubernetes, Docker) > > Does the Go runtime have

[go-nuts] Go memory usage inside containers

2018-09-12 Thread Leigh McCulloch
Hi, Does anyone here know how Go interacts with memory limits inside containers? (e.g. Kubernetes, Docker) Does the Go runtime have similar problems as the Java runtime, in that it doesn't know what the container limit is, and only knows what the physical limit is for the entire instance? Or