I am using a HashMap which stores 1000 entries at a time. After processing the records I call clear() method and loads 1000 fresh entries for same HashMap reference. I have to do this same process for 2,000,0000 records. Buyt after processing only 750,000 its gives me Exception in thread "ThreadedStreamConsumer" java.lang.OutOfMemoryError: Java heap space.
I have also tried WeekHashMap but it also didn't work out for me. What should be the effective method to handle this?
2,000,0000 recordsare stored in database?