Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Memory profiling a method call(How to do memory profiling on a method call)
Memory profiling a method call [message #559013] Wed, 15 September 2010 10:30 Go to next message
Juan  is currently offline Juan
Messages: 3
Registered: September 2010
Junior Member
Hello,

I want to know the memory that a method consumes when it is called (i.e. all objects it creates as local variables, and also recursively in all methods it calls)

I use the "Profile on server" option as it is in a J2EE Spring web application.

If I specify a class filter it works fine, though the filter should be a lot more large (the class inclusion tree is large)

To make it simpler i wanted to profile all classes (no class filter) and activate the profiling just before calling my method.

If I do so (select no class filter and deselect the option "Automatically start profiling..."), and try to activate the profiling just before calling the method, I get a console error: "[Error: EC JPIAgent received message (FATAL ERROR): Internal error (see log file).]" and the server terminates!. I don't know the location of that log file...

Anyway, is there a way to do memory profile only inside the execution of a method? I've set the "method" property in the class filter but it has no effect. I don't understand how this parameter works when doing memory profile.

Thanks in advance

Juan Jose Luna
Re: Memory profiling a method call [message #559157 is a reply to message #559013] Wed, 15 September 2010 19:29 Go to previous messageGo to next message
Jonathan West is currently offline Jonathan West
Messages: 49
Registered: July 2009
Member
Hi Juan, generally speaking you should not use am empty filterset. Profiling introduces a large overhead, so the filter set should always exclude classes for which you have no control (java.*, sun.*, any 3rd-party libraries, etc). The stats for these methods will still be collected implicitly, but they will be included as part of the stats of the unfiltered calling methods.

As for the 'method' field, as part of the filter this specifies which classes will be instrumented for memory analysis, as well as what objects will be analyzed. So if you include a method, un-filtered objects allocated in that method will be profiled. If you exclude a method, no allocated objects in that method will be profiled.
Re: Memory profiling a method call [message #559380 is a reply to message #559013] Thu, 16 September 2010 13:46 Go to previous messageGo to next message
Juan  is currently offline Juan
Messages: 3
Registered: September 2010
Junior Member
Thanks for the info.

But, suppose the following, If I include the method i want to profile, i.e. com.me.MyClass.theMethod, and I want to profile how much memory that method allocates for example, of classes BigDecimal and String, so I include java.math.Bigdecimal and java.lang.String. Then, will also the BigDecimals and Strings that are allocated outside of theMethod counted in the profile? I want to obtain results only for Strings and BigDecimals allocated in the method, not in other places of the application.

Would this filter do what I want?

Class_______________Method name______Rule
java.math.BigDecimal___*________________INCLUDE
java.lang.String________ *________________INCLUDE
com.me.myClass______ theMethod________INCLUDE
* ___________________ *________________EXCLUDE

Thanks
Re: Memory profiling a method call [message #560024 is a reply to message #559013] Mon, 20 September 2010 19:12 Go to previous messageGo to next message
Jonathan West is currently offline Jonathan West
Messages: 49
Registered: July 2009
Member
Hi Juan, your filter should work, as long as you enable the 'Show Object Allocation' profiling option in the Profile Configurations dialog. Then, once you see BigDecimal and String in the Memory Analysis view, you can double click them (or right click and select show object allocations), and this should bring you to the second tab which will show you who allocated them and where.
Re: Memory profiling a method call [message #560091 is a reply to message #560024] Tue, 21 September 2010 07:50 Go to previous message
Juan  is currently offline Juan
Messages: 3
Registered: September 2010
Junior Member
Thanks, I'll try that (Sorry I've been very busy lately)
Previous Topic:Why TPTP stop profiling after server started
Next Topic:Plans for upcoming TPTP releases
Goto Forum:
  


Current Time: Tue Sep 16 00:59:51 GMT 2014

Powered by FUDForum. Page generated in 0.02994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software