You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/01/07 22:06:24 UTC

[GitHub] [geode] DonalEvans commented on a change in pull request #7234: GEODE-9854: Orphaned .drf file causing memory leak

DonalEvans commented on a change in pull request #7234:
URL: https://github.com/apache/geode/pull/7234#discussion_r780541411



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
##########
@@ -7642,4 +7652,23 @@ public void sendTo(DataOutput out) throws IOException {
 
   }
 
+  /**
+   * Used to track all information's about live entries that region has in this oplog.
+   * That information is only needed until oplog is compacted. This is because compaction will
+   * clear all live entries from this oplog.
+   */
+  private static class RegionMap {
+
+    final AtomicReference<ConcurrentMap<Long, DiskRegionInfo>> regionMap =
+        new AtomicReference<>(new ConcurrentHashMap<>());
+
+    public void close() {
+      regionMap.set(null);

Review comment:
       Rather than setting the reference to null here and then creating and returning a `new ConcurrentHashMap` on every subsequent `get()` call, would it be more efficient to instead have `close()` simply set the reference to be a `new ConcurrentHashMap`? If this would work, then there isn't any need for this inner class, as the call to `regionMap.close()` can just be `regionMap.set(new ConcurrentHashMap<>())`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org