SammyVimes commented on code in PR #10045:
URL: https://github.com/apache/ignite/pull/10045#discussion_r883546860


##########
modules/core/src/main/java/org/apache/ignite/internal/util/GridHandleTable.java:
##########
@@ -181,6 +203,32 @@ private void growEntries() {
         objs = newObjs;
     }
 
+    /**
+     * Tries to gradually shrink hash table by factor of two when it's cleared.
+     *
+     * @return {@code true} if shrinked the table, {@code false} otherwise.
+     */
+    private boolean shrink() {
+        int newLen = objs.length;
+
+        if (newLen > initCap) {
+            int shrinked = (newLen - 1) / 2;

Review Comment:
   Because we grow it as "(size  << 1) + 1"



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to