I use a hashmap structure to store a mapping between a parent document(Key) and list of all associated sub documents(Value) with that parent document. This needs to be iterated later on to process the mapping. The key as well as each value in the List is usually 75-100 characters long file name. This works fine but there are 50000 parent documents each with 50-100 sub documents associated with it. So this creates a huge object load in memory. Is there any better way to store this mapping in a memory efficient way?
Map<String, List<String>> docmap=new HashMap<String,List<String>>();