(Beginner Android Question: ) I'm loading a 25MB thesaurus text file into a HashMap but I get an Out Of Memory Fatal Exception. I have researched this site to find ideas on other ways to do this but am still unsure. Would it be sensible to split the text file into a number of smaller ones (say 26, one for each letter) , and then read these from text file to HashMap as needed by the program ? Are there better ways to do this ? The app is meant to show all the synonyms for words inputted by the user.
12-23 13:04:44.336: E/AndroidRuntime(9865): FATAL EXCEPTION: main
12-23 13:04:44.336: E/AndroidRuntime(9865): Process: com.example.dictfromtextfile, PID: 9865
12-23 13:04:44.336: E/AndroidRuntime(9865): java.lang.OutOfMemoryError: Failed to allocate a 6532 byte allocation with 4262 free bytes and 4KB until OOM
12-23 13:04:44.336: E/AndroidRuntime(9865): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95