Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Questions in profiler  RSS feed

 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am currently working on increasing the performance of an application. The application has jsps, servlets, ejbs and uses oc4j as Application Server and Oracle 10g as database.

I used Oracle 10g memory profiler to get the results after performing an operation.

Class Count Size

char[]----------------> 26553 ---------> 2624556
java.lang.String ---------> 25921 ---------> 622
java.lang.Integer ---------> 2724 ---------> 32688
java.lang.Object[] ---------> 2396 ---------> 153444
java.util.Vector ---------> 163 ---------> 27912
com.aa.bb.Class1 ---------> 593 ---------> 82936
com.aa.bb.Class2 ---------> 66 ---------> 1356
com.aa.bb.Class3 ---------> 60 ---------> 1708

My question is

Since the operation is over, why should there be all these objects in the memory. Also the classes which we wrote is also residing in the memory.

Is it ok to get such classes in the memory for the used classes or should they be nullified.

Also when I did this operation, I was able to complete the operation. But the same operation for different requirement does not complete. It hangs as such.

Please let me know how should I handle this.

Thanks
[ May 30, 2006: Message edited by: vjy chin ]
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends on the your heap memory size. Java will do a GC if the free memory falls below the threshold level. You have to see if some other objects are holding the reference. Mostly the classes (Metadata) will not be unloaded until it's necessary to free up the memory. It's not clear what the reason for apps to hang when you execute the second time.

If you are very much concerned about the live objects force GC from the OAS and compare the live objects in memory. I am not sure if the server has an option to let you do this. I know WebLogic as such an option.
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

As for the second time it fails because it has more number of requirements or records to handle. Basically its the same operation, but more work.

for e.g. adding 2 nos and adding 20 nos.

I checked using Oracle Jdeveloper Memory Profiler and there was no statements or resultsets open. But I found some objects hanging in the memory

com.aa.bb.Class3 ---------> 60 ---------> 1708

even after the operation is over for the first time. So would that be a problem.

I didnt try this yet for the secound case making the objects null, since it will take 2 days to finish.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!