You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/03/06 15:20:39 UTC

[1/2] activemq-artemis git commit: This closes #1929

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 79ad9cb25 -> 9becaeb6b


This closes #1929


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

Branch: refs/heads/master
Commit: 9becaeb6b6861c7f5c702b6a43c55a303f7109dc
Parents: 79ad9cb 7f606a4
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Mar 6 10:20:32 2018 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Mar 6 10:20:32 2018 -0500

----------------------------------------------------------------------
 .../artemis/core/paging/cursor/impl/PageSubscriptionImpl.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: ARTEMIS-1728 Reclaim memory when page cursor complete

Posted by cl...@apache.org.
ARTEMIS-1728 Reclaim memory when page cursor complete

Free hash set used to hold page position for acks and removed refs.
The two set is cleared, but they still hold a big array.

It is safe to replace the old one with empty set.


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

Branch: refs/heads/master
Commit: 7f606a469023b8422ec4f3da4a55a7ddf7363d1f
Parents: 79ad9cb
Author: huaishk <sh...@gmail.com>
Authored: Mon Mar 5 17:32:29 2018 +0800
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Mar 6 10:20:32 2018 -0500

----------------------------------------------------------------------
 .../artemis/core/paging/cursor/impl/PageSubscriptionImpl.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7f606a46/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
index d970f8a..a767c09 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
@@ -334,7 +334,9 @@ final class PageSubscriptionImpl implements PageSubscription {
          }
 
          infoPG.acks.clear();
+         infoPG.acks = Collections.synchronizedSet(new LinkedHashSet<PagePosition>());
          infoPG.removedReferences.clear();
+         infoPG.removedReferences = new ConcurrentHashSet<>();
       }
 
       tx.addOperation(new TransactionOperationAbstract() {
@@ -901,11 +903,11 @@ final class PageSubscriptionImpl implements PageSubscription {
       private final long pageId;
 
       // Confirmed ACKs on this page
-      private final Set<PagePosition> acks = Collections.synchronizedSet(new LinkedHashSet<PagePosition>());
+      private Set<PagePosition> acks = Collections.synchronizedSet(new LinkedHashSet<PagePosition>());
 
       private WeakReference<PageCache> cache;
 
-      private final Set<PagePosition> removedReferences = new ConcurrentHashSet<>();
+      private Set<PagePosition> removedReferences = new ConcurrentHashSet<>();
 
       // The page was live at the time of the creation
       private final boolean wasLive;