I am not able to debug the issue ,what are the possibilities it can happen. Can anyone tell me ?
3 Answers
There are some tools available for memory profiling.
1) Eclipse Memory Analyzer (MAT)
See the reports generated through tools and fix the issue mention in memory profiling reports.
You can use any one of them to generate report
1 Comment
Use command line 'breakpoints'. A few lines in, add something like
System.out.println("Made it thus far!");
or in code with lots of loops, you can use this to make sure that you don't iterate too many times:
System.out.println("Made it thus far! i = " + i1);
where i1 is an additional loop counter.
and move it down and down until you get your error instead of that print. This will help determine the line at which the error is occurring.
Please remember to post your code if you can as it makes the job a whole lot easier and you can have your problem solved in under a minute.
6 Comments
OutOfMemoryError is thrown. You may as well analyze the stack trace of the error which should show recent method calls.
-XX:+HeapDumpOnOutOfMemoryError?