I am using TPTP eclipse plugin as profiler to find the memory leak.I have written one small program to profile my first program but profiler is not able to find the object creation .Here is my program:-
Profiler is only showing one object created in main method .But it not able to find the object creation in the run method.Am i doing anything wrong here?This is my first program which i am running using profiler.
String objects which cannot be referenced once the 'for loop' executes are very likely garbage collected, which is why the profiler is unable to show them.
No i am adding all the objects to list using addObj method, so all the strings should not be garbage collectible.Also if I increase the for loop limit to 200000000000000 from current 2000, I will get out of memory exception. Profiler should be able to catch it as it is a memory leak. Is this behavior specific to this profiler only or is common in all the profilers?