default -Xmx8G in wrapper-properties.conf has no effect on agent.jar
See original GitHub issueBug Report / Documentation Report
Summary
After encountering for a few times this error:
2020-01-24 14:48:38,619 ERROR [scheduler-2] TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task.
java.lang.OutOfMemoryError: Java heap space
I decided to increase memory for the go-agent.
According to this comment and performance tuning docs wrapper-properties.conf
is the right place. So I removed #
from wrapper.java.additional.105=-Xmx8G
in /usr/share/go-agent/wrapper-config/wrapper-properties.conf
It turned out it has no effect.
After some digging I added -Xms1g -Xmx2g
to set.default.AGENT_STARTUP_ARGS
parameter in wrapper.conf
(instead wrapper-properties.conf
) and that fixed the java.lang.OutOfMemoryError
problem.
I’ve noticed that:
wrapper.java.additional.*
inwrapper-properties.conf
works only foragent-bootstrapper.jar
AGENT_STARTUP_ARGS
inwrapper.conf
works foragent.jar
, besidesXmx
it was also tested with-Dtoggle.agent.git.clean.keep.ignored.files
Environment
Basic environment details
- Go Version:
go-agent 19.7.0-9567
- JAVA Version:
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.1+12, mixed mode, sharing)
- OS:
Ubuntu 16.04 xenial
Additional Environment Details
Agent installation was upgraded from /etc/default/go-agent
Possible Fix
I’m not familiar with java service wrapper but this line is commented out https://github.com/gocd/gocd/blob/master/installers/include/additional-properties.conf#L3
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
@suside That change you proposed makes sense to me.
Yes, I understand. If someone gets confused, I think it’s on the documentation to be less confusing and not on the person to have “known better”. So, it’s definitely not on you. 😃
👍 What you think about splitting performance_tuning.md Things to Remember into two sections like so https://github.com/suside/docs.go.cd/commit/b0911c08098ff56bc3a67d9538f4d43be11ea44e
Yeah, it kinda is now for me too, but when searching for mem error for the first time… You see
Xmx
in the docs and in the file, which is present on the agent… well it was confusing.