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 2021/03/23 19:28:44 UTC

[GitHub] [geode] DonalEvans commented on a change in pull request #6176: GEODE-9051: Added a feature to measure the Tenured heap consumption

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



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/control/HeapMemoryMonitor.java
##########
@@ -670,12 +673,31 @@ public void run() {
         // Not using the information given by the notification in favor
         // of constructing fresh information ourselves.
         if (!testDisableMemoryUpdates) {
+          try {
+            String notifType = notification.getType();
+            if (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
+                notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
+              // retrieve the memory notification information
+              CompositeData cd = (CompositeData) notification.getUserData();
+              MemoryNotificationInfo info = MemoryNotificationInfo.from(cd);
+              MemoryUsage usage = info.getUsage();
+              long usedBytes = usage.getUsed();
+              logger.info(
+                  "A tenured heap garbage collection has occurred.  New tenured heap consumption: "
+                      +
+                      usedBytes);
+            }
+          } catch (Exception e) {
+            logger.info(
+                "An Exception occureed while attempting to print out tenured heap consumption", e);

Review comment:
       Typo here, this should be "occurred". Also, it might be better to say "while attempting to log tenured..."




-- 
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.

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