activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Burton (JIRA)" <>
Subject [jira] [Created] (AMQ-5571) ActiveMQ fails to gracefully shut down if ACTIVEMQ_OPTS_MEMORY uses > 50% of memory
Date Sun, 08 Feb 2015 21:00:34 GMT
Kevin Burton created AMQ-5571:

             Summary: ActiveMQ fails to gracefully shut down if ACTIVEMQ_OPTS_MEMORY uses
> 50% of memory
                 Key: AMQ-5571
             Project: ActiveMQ
          Issue Type: Bug
            Reporter: Kevin Burton

I’m allocating about 6GB of RAM to ActiveMQ.  The problem is that this box only has 4GB
free after that.

If I try to gracefully shut down ActiveMQ tries to run "stop" to gracefully request that ActiveMQ
shutdown to avoid recovery on startup.

The problem is that this uses the ACTIVEMQ_OPTS_MEMORY again and since I'm setting memory
settings to maximum here this simple command tries to allocate another 9GB.

However, this will fail.  because ACTIVEMQ_OPTS includes ACTIVEMQ_OPTS_MEMORY which is where
I set the daemon to use large amounts of memory.

I THINK the resolution to this is to ONLY use ACTIVEMQ_OPTS_MEMORY in "start"…. wouldn’t
you agree?

This has a second issue where since I’ms eating -Xms and -Xmx and allocating another 6GB
during stop it could trigger an OOM killer and will definitely invalidate a large chunk of
the VFS page cache.

Here's a patch that fixes the issue.  

It does NOT fix the issue for the 'status' command.  That would take a larger refactoring
of the init script and I'd like to avoid that for now since bash scripts can be fragile.

Index: artemis-ansible/roles/artemis-scheduler/files/usr/share/apache-activemq/bin/activemq
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
--- artemis-ansible/roles/artemis-scheduler/files/usr/share/apache-activemq/bin/activemq	(revision
+++ artemis-ansible/roles/artemis-scheduler/files/usr/share/apache-activemq/bin/activemq	(revision
@@ -250,7 +250,7 @@
 if [ -z "$ACTIVEMQ_OPTS" ] ; then
+    ACTIVEMQ_OPTS="$ACTIVEMQ_CONF/login.config"
 # create configuration if requested
@@ -394,7 +394,7 @@
    # Execute java binary
    if [ -n "$PIDFILE" ] && [ "$PIDFILE" != "stop" ];then
               -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
               -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
               -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
\ No newline at end of file

This message was sent by Atlassian JIRA

View raw message