| Author |
profiler not able to find object creation
|
raj malhotra
Ranch Hand
Joined: Feb 22, 2007
Posts: 285
|
|
HI
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.
Thanks,
Raj
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
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.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
raj malhotra
Ranch Hand
Joined: Feb 22, 2007
Posts: 285
|
|
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?
Thanks,
Raj
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
Any profiler can determine that there are many String objects when the line "System.out.println(list);" is up for execution. I do not have the profiler in question, so I am not sure what is wrong.
|
 |
 |
|
|
subject: profiler not able to find object creation
|
|
|