activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-874: ThreadGroup memory leak
Date Fri, 05 May 2017 18:49:54 GMT
ARTEMIS-874: ThreadGroup memory leak


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/18bc7e1a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/18bc7e1a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/18bc7e1a

Branch: refs/heads/master
Commit: 18bc7e1a2ee9add2c97e19bdd6433715e97d02d8
Parents: 4f22a56
Author: dOkI <denis.kirpichenkov@gmail.com>
Authored: Fri May 5 22:10:59 2017 +0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri May 5 14:49:47 2017 -0400

----------------------------------------------------------------------
 .../apache/activemq/artemis/utils/ActiveMQThreadFactory.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/18bc7e1a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java
index e5f76d3..1644715 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java
@@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 public final class ActiveMQThreadFactory implements ThreadFactory {
 
-   private final ThreadGroup group;
+   private String groupName;
 
    private final AtomicInteger threadCount = new AtomicInteger(0);
 
@@ -59,7 +59,7 @@ public final class ActiveMQThreadFactory implements ThreadFactory {
     * @param tccl      the context class loader of newly created threads
     */
    public ActiveMQThreadFactory(final String groupName, String prefix, final boolean daemon,
final ClassLoader tccl) {
-      group = new ThreadGroup(groupName + "-" + System.identityHashCode(this));
+      this.groupName = groupName;
 
       this.prefix = prefix;
 
@@ -97,7 +97,7 @@ public final class ActiveMQThreadFactory implements ThreadFactory {
    }
 
    private Thread createThread(final Runnable command) {
-      final Thread t = new Thread(group, command, prefix + threadCount.getAndIncrement()
+ " (" + group.getName() + ")");
+      final Thread t = new Thread(command, prefix + threadCount.getAndIncrement() + " ("
+ groupName + ")");
       t.setDaemon(daemon);
       t.setPriority(threadPriority);
       t.setContextClassLoader(tccl);


Mime
View raw message