I am trying to insert about 50,000 objects (and therefore 50,000 keys) into a java.util.HashMap
. However, I keep getting an OutOfMemo
Some people are suggesting changing the parameters of the HashMap to tighten up the memory requirements. I would suggest to measure instead of guessing; it might be something else causing the OOME. In particular, I'd suggest using either NetBeans Profiler or VisualVM (which comes with Java 6, but I see you're stuck with Java 5).