Skip to content

Commit bb81082

Browse files
committed
CLOUDSTACK-7951: Limit amount of memory used by cloudstack-agent jsvc
The -Xms value specifies the minimum heap size the JVM should start with and -Xmx is the maximum heap size it can grow. The previous fix imposed minimum limit of 1G which is unreasonably for small deployments. The fix is to start with 256MB and limit to 2G for cloudstack-agent process. This was tested on DevCloud/KVM and then again on a ACS/KVM deployment on real hardware. With these values, it's possible for the agent to work in a DevCloud/KVM environment and if JVM needs it can increase the heap size to 2G. The fix also ports these settings to Debian cloud-agent init.d script as well. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 20de43f commit bb81082

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎packaging/centos63/cloud-agent.rc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/a
6666
start() {
6767
echo -n $"Starting $PROGNAME: "
6868
if hostname --fqdn >/dev/null 2>&1 ; then
69-
$JSVC -Xms1024m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
69+
$JSVC -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
7070
-errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
7171
RETVAL=$?
7272
echo

‎packaging/debian/init/cloud-agent‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ start() {
9696

9797
wait_for_network
9898

99-
if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -Djna.nosys=true -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
99+
if start_daemon -p $PIDFILE $DAEMON -Xms256m -Xmx2048m -cp "$CLASSPATH" -Djna.nosys=true -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
100100
RETVAL=$?
101101
then
102102
rc=0

0 commit comments

Comments
 (0)