Memory overhead of shrinking collections

Viewed 274

I have been studying Java Collections recently. I noticed that ArrayList, ArrayDeque or HashMap contains helper functions which expand capacity of the containers if necessary, but neither of them have function to narrow the cap if the container gets empty.

If I am correct, is the memory cost of references (4 byte) so irrelevant?

1 Answers
Related