Hi All,
I have a program which reads a text file with comma separated value(size 3MB). Then the file will be read into StringBuffer which is then tokenized using StringTokenizer.
I see memory leak in JVM when I store the
string returned from the nextToken operation when it is stored in static hashmap.
When I run a Jprobe I find the a char array being created in JVM which will not be released untill the key or value which is referenced to the string returned from the nexttoken is released from hashmap.
The memory occupied in Heap memory in this case is around 7MB
Why is that JVM not releasing the char array memory during Garbage collection. Do you have any idea?
I have attached the sample program below
[ October 21, 2008: Message edited by: vijay kumar ]
[ October 21, 2008: Message edited by: vijay kumar ]
[Nitesh: Added code tags. Kindly use
code tags while posting code.]
[ October 21, 2008: Message edited by: Nitesh Kant ]