my program will do this:
- create HashMap a
- add mappings
- prune many mappings (maybe 80% or so)
- HashMap a will be stored as a property in Object b (b.hashMap)
- there will be many b objects.
I'm thinking that HashMap a might have much wasted space because of the objects that existed initially but are no longer there.
So I'm thinking about doing something like this (after pruning a):
- HashMap compactA = new HashMap(a)
- b.hashMap = compactA (instead of b.hashMap = a)
What do you think? Will this be more memory efficient? Or should I not bother?