common GoLang memory issues

Go will try to optimize for the number of cores reported on the system. For Docker executor jobs the environment will report the number of cores on the VM rather than the available cores for the container. This can cause go to spawn too many workers and use all your jobs memory. set GOMAXPROCS to the number of cores available to your job. The default resource class (medium) for docker executor jobs has 2 cores available.

jobs:
  build:
    docker:
      - image: circleci/golang:1.12
environment:
GOMAXPROCS: 2 steps: - run:
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.