Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build prometheus on amd64 need >512mb memory to work #534

Closed
pyk opened this Issue Feb 17, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@pyk
Copy link

pyk commented Feb 17, 2015

while running make build on the following VM

prometheus (master) $ free -h
             total       used       free     shared    buffers     cached
Mem:          489M       209M       280M        12M       6.8M        67M
-/+ buffers/cache:       134M       354M
Swap:           0B         0B         0B

i tried two times to build, but failed with the following message

make -C config
make[1]: Entering directory `/home/vagrant/go/src/github.com/pyk/prometheus/config'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/go/src/github.com/pyk/prometheus/config'
curl -o /home/vagrant/go/src/github.com/pyk/prometheus/.build/cache/go1.4.linux-amd64.tar.gz -L https://golang.org/dl/go1.4.linux-amd64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    85  100    85    0     0      6      0  0:00:14  0:00:12  0:00:02    23
100 60.3M  100 60.3M    0     0   620k      0  0:01:39  0:01:39 --:--:--  829k
tar -C /home/vagrant/go/src/github.com/pyk/prometheus/.build/root -xzf /home/vagrant/go/src/github.com/pyk/prometheus/.build/cache/go1.4.linux-amd64.tar.gz
touch /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/bin/go
cp -a /home/vagrant/go/src/github.com/pyk/prometheus/Godeps/_workspace /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/gopath
ln -s /home/vagrant/go/src/github.com/pyk/prometheus /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/gopath/src/github.com/prometheus/prometheus
make -C tools
make[1]: Entering directory `/home/vagrant/go/src/github.com/pyk/prometheus/tools'
make -C rule_checker
make[2]: Entering directory `/home/vagrant/go/src/github.com/pyk/prometheus/tools/rule_checker'
TMPDIR=/tmp GOROOT=/home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go GOPATH=/home/vagrant/go/src/github.com/pyk/prometheus/.build/root/gopath /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/bin/go build -o rule_checker .
make[2]: Leaving directory `/home/vagrant/go/src/github.com/pyk/prometheus/tools/rule_checker'
make[1]: Leaving directory `/home/vagrant/go/src/github.com/pyk/prometheus/tools'
make -C web
make[1]: Entering directory `/home/vagrant/go/src/github.com/pyk/prometheus/web'
# Note that embed-static.sh excludes map files and the
# non-minified bootstrap files.
../utility/embed-static.sh static templates | /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/bin/gofmt > blob/files.go
make[1]: Leaving directory `/home/vagrant/go/src/github.com/pyk/prometheus/web'
TMPDIR=/tmp GOROOT=/home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go GOPATH=/home/vagrant/go/src/github.com/pyk/prometheus/.build/root/gopath /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/bin/go build -o prometheus -ldflags " -X main.buildVersion 0.10.0 -X main.buildRevision 79a4a6d -X main.buildBranch master -X main.buildUser vagrant@priceable -X main.buildDate 20150218-04:27:53 -X main.goVersion 1.4" .
go build github.com/prometheus/prometheus/stats: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/storage/metric: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/storage/local/flock: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/syndtr/goleveldb/leveldb/util: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/syndtr/goleveldb/leveldb/comparer: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/syndtr/gosnappy/snappy: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/utility/test: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/storage/remote: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/storage/remote/opentsdb: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/web/httputils: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
go build github.com/prometheus/prometheus/web/blob: /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: fork/exec /home/vagrant/go/src/github.com/pyk/prometheus/.build/root/go/pkg/tool/linux_amd64/6g: cannot allocate memory
make: *** [build] Error 1

after upgrading a VM

prometheus (master) $ free -h
             total       used       free     shared    buffers     cached
Mem:          993M       234M       759M        12M        13M        99M
-/+ buffers/cache:       121M       872M
Swap:           0B         0B         0B

now it succes to build & run flawlessly

prometheus (master) $ ./prometheus -config.file=../prometheus-getstarted/prometheus.conf
prometheus, version 0.10.0 (branch: master, revision: 79a4a6d)
  build user:       vagrant@priceable
  build date:       20150218-05:03:49
  go version:       1.4
@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Feb 18, 2015

Thanks for the report!

Yes, sorry - this is expected. Prometheus needs around 600MB of RAM to build (as measured by running make build in a cgroup and looking at memory.max_usage_in_bytes). To my knowledge there's not much we can do about that at the moment. Maybe the Go compiler will become more modest in its memory usage in the future. For now you'll need to build Prometheus on a machine with at least that much memory and a bit of headroom for the rest of the OS.

Closing.

@juliusv juliusv closed this Feb 18, 2015

simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017

Merge pull request prometheus#534 from prometheus/dates
Document new date/time related functions.
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.