Memory leak with go-1.7 in alpine-3.4 (golang)

2 posts / 0 new
Last post
#1 Mon, 2016-12-12 12:41
jjjaime
  • jjjaime's picture
  • Offline
  • Last seen: 1 year 3 months ago
  • Joined: 2016-12-12

The latest production alpine version (v3.4) provides the package go-1.6.3-r0 (https://pkgs.alpinelinux.org/package/v3.4/community/x86_64/go). However, I would like to use go-1.7 because of the improvements in garbage collector.

My dockerfile included the following fragment:

FROM alpine:3.4
...
RUN apk add --no-cache --virtual .build-deps git go && ...

I updated it to install go-1.7.3-r0 (https://pkgs.alpinelinux.org/package/edge/community/x86_64/go):

FROM alpine:3.4
...
RUN apk add --no-cache --virtual .build-deps musl-dev git go --repository <a href="http://nl.alpinelinux.org/alpine/edge/community/" rel="nofollow">http://nl.alpinelinux.org/alpine/edge/community/</a> --allow-untrusted && ...

However, I've seen that this change creates a memory leak for every API request. With a performance test, it consumes 4GB in 15 minutes.

What I've seen is that I had to install musl-dev and perhaps the conflict is that musl version does match because I did not install musl from edge packages but maintain the official one. Is there any possibility to install go-1.7 in alpine v3.4 without the memory leak? Does it make sense?

I guess that it is not convenient to use an edge version or and edge package. I'll try alpine-edge, to verify that the memory leak is not present, but I don't think it's a good idea to use it in production. With the current situation, I had to restore go-1.6.

Mon, 2016-12-12 14:55
jjjaime
  • jjjaime's picture
  • Offline
  • Last seen: 1 year 3 months ago
  • Joined: 2016-12-12

Using

FROM alpine:edge
...
RUN apk add --no-cache --virtual .build-deps musl-dev git go && ...

and the memory leak still exists.

I can confirm that it's not a problem with go-1.7 because I cannot reproduce the memory leak in my laptop (with go-1.7) but only with the go-1.7.3-r0 package for alpine (https://pkgs.alpinelinux.org/package/edge/community/x86_64/go).

Log in or register to post comments