I have a ConcurrentHashMap like so:
HashMap<String, Integer> fruitMap = new ConcurrentHashMap<>();
The key is a String of 10 characters, the value is an Integer.
Assuming there is no other memory consuming code in my application, how do I calculate the number of entries that can be stored in the HashMap on a server with 10GiB memory?
It'll be great if you can mention how we can calculate it for both Java 7 and Java 8 or later.
PS: I found this, but I didn't understand how the 6.75KB memory usage for hashmap of 100 ints mapped to ints was arrived at.