How to avoid OutOfMemoryError
In my information retrieval project, I have to build a vector space model. So there are three arrays, i.e. a string array IndexTerm, a string array FileName[j], and a double array weight[j]. The total number of the files is about ten thousand, while the number of index terms might be twenty thousand. This causes a serious problem, i.e. java.lang.OutOfMemoryError
Could anybody tell me how to avoid this without reducing the number of files and index terms?

