I realized that problem is in some other method.
Here is what this method is supposed to do :
Input File(input.txt) is like this :
The output will contain the following :
1. The total Number of records in the input file -- in the above example it will be 10.
2.The number of unique values in the first column -- in this case 6.
3. The number of unique values in the second column -- In this case it will be 3 (CNN,FOX and USA).
This is what my code look like :
This is working just fine as I said in my previous post but when input file has large number of records (say 1 Billion or so) then it crashes saying 'OutofMemoryError'.
So where is the memory leak ? what is the better option to handle such a large file ?
Your input is appreciated.
[ edited to correct code formatting -ds ]
[ August 07, 2002: Message edited by: Dirk Schreckmann ]