You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/07/14 15:23:33 UTC

[GitHub] [cassandra] jonmeredith commented on a change in pull request #582: Add support for lazy NoSpamLogger argument evaluation

jonmeredith commented on a change in pull request #582:
URL: https://github.com/apache/cassandra/pull/582#discussion_r454439858



##########
File path: src/java/org/apache/cassandra/utils/memory/BufferPool.java
##########
@@ -232,8 +236,8 @@ private Chunk allocateMoreChunks()
                     if (MEMORY_USAGE_THRESHOLD > 0)
                     {
                         noSpamLogger.info("Maximum memory usage reached ({}), cannot allocate chunk of {}",
-                                          prettyPrintMemory(MEMORY_USAGE_THRESHOLD),
-                                          prettyPrintMemory(MACRO_CHUNK_SIZE));
+                                          () -> params(prettyPrintMemory(MEMORY_USAGE_THRESHOLD),
+                                                       prettyPrintMemory(MACRO_CHUNK_SIZE)));

Review comment:
       I think pre-computing them is a good plan where constant or they are set infrequently.  The `sizeInBytes()` in the failed allocation will be variable, but fixing all the other occurrences would definitely be a good thing.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org