Java Hashmap. How many maximum records should it be used for?
hashmap, java, jvm, memory-management
Solution
10K objects is a drop in the bucket (pardon the pun) as far as memory goes.
Try it and see, but I think you'll find even the most modest memory capacity these days will handle it. Make sure you have a reasonable heap size: `-Xmx512m` or whatever
Problem
I have 10,000 mappings. Will it be a good idea to put them all in a java Hashmap and access ? This will save database transactions as all 10,000 records will be present in memory itself. Every mapping will have around 100 characters including key and value and mappings will be quite distinct. Asking this question since don't have great experience in java or on similar situation.