Skip to content

Commit 19d73fe

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> (cherry picked from commit bb81082) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 4f82528 commit 19d73fe

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
@@ -64,7 +64,7 @@ export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/a
6464
start() {
6565
echo -n $"Starting $PROGNAME: "
6666
if hostname --fqdn >/dev/null 2>&1 ; then
67-
$JSVC -Xms1024m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
67+
$JSVC -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \
6868
-errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
6969
RETVAL=$?
7070
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)