activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1084633 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/BrokerService.java store/amq/AMQPersistenceAdapter.java store/journal/JournalPersistenceAdapter.java
Date Wed, 23 Mar 2011 16:36:55 GMT
Author: gtully
Date: Wed Mar 23 16:36:55 2011
New Revision: 1084633

URL: http://svn.apache.org/viewvc?rev=1084633&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-2852 - Memory leak when undeploying webapp with
ActiveMQ client - AMQ store piece

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=1084633&r1=1084632&r2=1084633&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Wed Mar 23 16:36:55 2011
@@ -2231,7 +2231,7 @@ public class BrokerService implements Se
         return this.executor;
     }
     
-    protected synchronized Scheduler getScheduler() {
+    public synchronized Scheduler getScheduler() {
         if (this.scheduler==null) {
             this.scheduler = new Scheduler("ActiveMQ Broker["+getBrokerName()+"] Scheduler");
             try {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java?rev=1084633&r1=1084632&r2=1084633&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Wed Mar 23 16:36:55 2011
@@ -174,11 +174,13 @@ public class AMQPersistenceAdapter imple
         }
         if (this.brokerService != null) {
             this.taskRunnerFactory = this.brokerService.getTaskRunnerFactory();
-        }else {
+            this.scheduler = this.brokerService.getScheduler();
+        } else {
+            this.taskRunnerFactory = new TaskRunnerFactory("AMQPersistenceAdaptor Task",
getJournalThreadPriority(),
+                true, 1000, isUseDedicatedTaskRunner());
             this.scheduler = new Scheduler("AMQPersistenceAdapter Scheduler");
         }
-        this.taskRunnerFactory= new TaskRunnerFactory("AMQPersistenceAdaptor Task", getJournalThreadPriority(),
-                true, 1000, isUseDedicatedTaskRunner());
+
         IOHelper.mkdirs(this.directory);
         lockFile = new RandomAccessFile(new File(directory, "lock"), "rw");
         lock();
@@ -201,10 +203,6 @@ public class AMQPersistenceAdapter imple
         referenceStoreAdapter.setUsageManager(usageManager);
         referenceStoreAdapter.setMaxDataFileLength(getMaxReferenceFileLength());
         
-        if (brokerService != null) {
-            this.scheduler = this.brokerService.getBroker().getScheduler();
-        }
-                
         if (failIfJournalIsLocked) {
             asyncDataManager.lock();
         } else {
@@ -336,6 +334,11 @@ public class AMQPersistenceAdapter imple
         IOException firstException = null;
         referenceStoreAdapter.stop();
         referenceStoreAdapter = null;
+
+        if (this.brokerService == null) {
+            this.taskRunnerFactory.shutdown();
+            this.scheduler.stop();
+        }
         try {
             LOG.debug("Journal close");
             asyncDataManager.close();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java?rev=1084633&r1=1084632&r2=1084633&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
Wed Mar 23 16:36:55 2011
@@ -333,8 +333,6 @@ public class JournalPersistenceAdapter i
     /**
      * When we checkpoint we move all the journalled data to long term storage.
      * 
-     * @param stopping
-     * @param b
      */
     public void checkpoint(boolean sync, boolean fullCheckpoint) {
         try {



Mime
View raw message