Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

profiler not able to find object creation

 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic