DOCKER: every command results in a fatal error: runtime: out of memory


To add context, I have a small server with 1GB memory on which I am trying to deploy a lot of shiny apps by dockerizing ShinyProxy using docker-compose.

I am adding app after app on ShinyProxy and testing it step by step. It used to work for the 4-5 first apps but now when I build my container using docker-compose up –build -d, I ended up with the following error from which I cannot get out…

fatal error: runtime: out of memory

runtime stack:<br />
runtime.throw(0x55e484ea7241, 0x16)<br />
    /usr/local/go/src/runtime/panic.go:617 +0x74 fp=0x7fff0428e880 sp=0x7fff0428e850 pc=0x55e4838d6084<br />
runtime.sysMap(0xc000000000, 0x4000000, 0x55e486e41e98)
    /usr/local/go/src/runtime/mem_linux.go:170 +0xc9 fp=0x7fff0428e8c0 sp=0x7fff0428e880 pc=0x55e4838c1399<br />
runtime.(*mheap).sysAlloc(0x55e486e28980, 0x2000, 0x55e486e28990, 0x1)
    /usr/local/go/src/runtime/malloc.go:633 +0x1cf fp=0x7fff0428e968 sp=0x7fff0428e8c0 pc=0x55e4838b41af <br />
runtime.(*mheap).grow(0x55e486e28980, 0x1, 0x0)
    /usr/local/go/src/runtime/mheap.go:1222 +0x44 fp=0x7fff0428e9c0 sp=0x7fff0428e968 pc=0x55e4838ce7a4 <br />
runtime.(*mheap).allocSpanLocked(0x55e486e28980, 0x1, 0x55e486e41ea8, 0x0)
    /usr/local/go/src/runtime/mheap.go:1150 +0x381 fp=0x7fff0428e9f8 sp=0x7fff0428e9c0 pc=0x55e4838ce691 <br />
runtime.(*mheap).alloc_m(0x55e486e28980, 0x1, 0x2a, 0x6e43a318)
    /usr/local/go/src/runtime/mheap.go:977 +0xc6 fp=0x7fff0428ea48 sp=0x7fff0428e9f8 pc=0x55e4838cdce6 <br />
runtime.(*mheap).alloc.func1()
    /usr/local/go/src/runtime/mheap.go:1048 +0x4e fp=0x7fff0428ea80 sp=0x7fff0428ea48 pc=0x55e4838fee0e <br />
runtime.(*mheap).alloc(0x55e486e28980, 0x1, 0x55e48301002a, 0x7fff0428eb20)
    /usr/local/go/src/runtime/mheap.go:1047 +0x8c fp=0x7fff0428ead0 sp=0x7fff0428ea80 pc=0x55e4838cdfbc <br />
runtime.(*mcentral).grow(0x55e486e29780, 0x0)
    /usr/local/go/src/runtime/mcentral.go:256 +0x97 fp=0x7fff0428eb18 sp=0x7fff0428ead0 pc=0x55e4838c0e17 <br />
runtime.(*mcentral).cacheSpan(0x55e486e29780, 0x7fbfd6083000)
    /usr/local/go/src/runtime/mcentral.go:106 +0x301 fp=0x7fff0428eb78 sp=0x7fff0428eb18  pc=0x55e4838c0921 <br />
runtime.(*mcache).refill(0x7fbfd6083008, 0x2a)
    /usr/local/go/src/runtime/mcache.go:135 +0x88 fp=0x7fff0428eb98 sp=0x7fff0428eb78 pc=0x55e4838c03b8 <br />
runtime.(*mcache).nextFree(0x7fbfd6083008, 0x55e486e1e82a, 0x7fbfd6083008, 0x7fbfd6083000, 0x8)
    /usr/local/go/src/runtime/malloc.go:786 +0x8a fp=0x7fff0428ebd0 sp=0x7fff0428eb98 pc=0x55e4838b49ea <br />
runtime.mallocgc(0x180, 0x55e485b93c00, 0x1, 0x55e486e41f00)
    /usr/local/go/src/runtime/malloc.go:939 +0x780 fp=0x7fff0428ec70 sp=0x7fff0428ebd0 pc=0x55e4838b5320 <br />
runtime.newobject(0x55e485b93c00, 0x4000)
    /usr/local/go/src/runtime/malloc.go:1068 +0x3a fp=0x7fff0428eca0 sp=0x7fff0428ec70 pc=0x55e4838b572a <br />
runtime.malg(0x3cba6700008000, 0x55e486e2aff0)
    /usr/local/go/src/runtime/proc.go:3220 +0x33 fp=0x7fff0428ece0 sp=0x7fff0428eca0 pc=0x55e4838df533 <br />
runtime.mpreinit(...)
    /usr/local/go/src/runtime/os_linux.go:311 <br />
runtime.mcommoninit(0x55e486e22c40)
    /usr/local/go/src/runtime/proc.go:618 +0xc6 fp=0x7fff0428ed18 sp=0x7fff0428ece0 pc=0x55e4838d8ea6 <br />
runtime.schedinit()
    /usr/local/go/src/runtime/proc.go:540 +0x78 fp=0x7fff0428ed70 sp=0x7fff0428ed18 pc=0x55e4838d8b38 <br />
runtime.rt0_go(0x7fff0428ee78, 0x2, 0x7fff0428ee78, 0x0, 0x7fbfd56b4b97, 0x2, 0x7fff0428ee78, 0x200008000, 0x55e483900e80, 0x0, ...)
    /usr/local/go/src/runtime/asm_amd64.s:195 +0x11e fp=0x7fff0428ed78 sp=0x7fff0428ed70 pc=0x55e483900fae

The problem is that every time I connect through ssh to my server, every docker command results in this error. I am literally stuck with it and don’t know how to get out.

I hope some docker pros can help me with this issue.

Thanks & Regards,

Maxime