Ngone51 commented on pull request #32790:
URL: https://github.com/apache/spark/pull/32790#issuecomment-866510223


   @mridulm Interesting example! I also investigate a bit on it. Looks like all 
the elements of the underlying array has been nulled out but remain the array 
refrence unchanged. So its size doesn't change. But the memory usage shouldn't 
be the same as before but it's also not empty since `null` still takes a bit 
memory.
   
   ```java
   public void clear() {
       Node<K,V>[] tab;
       modCount++;
       if ((tab = table) != null && size > 0) {
           size = 0;
           for (int i = 0; i < tab.length; ++i)
               tab[i] = null;
       }
   }
   ```


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to