aspose file tools*
The moose likes Performance and the fly likes Investigation of issues identifiable by a Profiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Investigation of issues identifiable by a Profiler " Watch "Investigation of issues identifiable by a Profiler " New topic
Author

Investigation of issues identifiable by a Profiler

Kris Ram
Greenhorn

Joined: Jul 16, 2012
Posts: 10
Hi guys,

I am doing an investigation on the use of profilers, and I am starting with JConcole. I will be creating a sample application and run it on Tomcat for that purpose.


The help I would appreciate is if some of you could let me know what issues that they have already encountered and which were identified by a profiler.

I will then try to reproduce the issue in my application and see if the Profiler is of any help.


Cheers
Kris
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Jconsole is a monitoring platform and not a profiler. I think you are looking at products like visualVM (free) or Jprofiler (commercial) which profile classes to give you fine grained application and system metrics.

Some profilers might come with sample applications that fail under certain conditions. You can try those or you can invent a scenario yourself. The easiest I can think of is to run an infinite loop or hold on to several object references forever. If you want the best bang out of taking a profiler for a test drive, apply it on a real application with a real problem. You will learn something that way.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Kris Ram
Greenhorn

Joined: Jul 16, 2012
Posts: 10
Hi Deepak,
thanks for the correction. I will try Visual VM and see how easy it is to use.

My end goal is once this small piece of research is done, I will need to investigate why I am getting 'Perm Gen' issue when deploying 2 web applications on Tomcat. They work individually, but when they are both on the same server the error arises. This also does not happen in development.


So hopefully these tools will help out.

Cheers
Kris
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

The perm gen is used by the JVM to store class metadata information. Perhaps the combined number of classes loaded by both application is too much for the JVM to take. You can use VM arguments to tell the JVM how much perm gen to use. Like so...



Increase the size of the permgen and check if that helps.
Kris Ram
Greenhorn

Joined: Jul 16, 2012
Posts: 10
Hi Deepak,

I have already been advised to make the change. But I wanted to first enquire what is the current size of PermGen on my Windows PC and my Linux server. Would you know the command/tool I need to find this out?


I am just finding it strange that this works on my average PC and not on a server.


Cheers
Kris
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Jconsole should be able to tell you that. In fact you should be able to monitor the permgen at runtime. You can also look at the server's startup script to check if this VM argument is set there.
Kris Ram
Greenhorn

Joined: Jul 16, 2012
Posts: 10
Hi Deepak,
I see that we have 3 options of Perm Gen Memory in JConsole (attached screenshot), and I am not sure which one I should be checking. I can can't find any good documentation on the net.

Would you know what each of them represents, and if possible let me know where I can find some helpful info about it.


Cheers
Kris


[JConsole_Mem_Options.jpg]

Kris Ram
Greenhorn

Joined: Jul 16, 2012
Posts: 10
Hi,

I have managed to use VM to know the size of the Perm Gen, its on the 'Monitor' tab.

The next thing I tried to do is to profile a small web application, however I cannot see my class or method in the list of profiled method(as shown in the attachment).




The way I have proceeded is :
1.) start tomcat
2.) start Visual VM
3.) go to the Profiler tab
4.) click on the CPU button
5.) access the web applicaiton through a browser


Is the process not right? Should I be doing something else to be able to see my application's method calls.


Cheers
kris


[Thumbnail for unable_to_find_class_or_method.jpg]

 
 
subject: Investigation of issues identifiable by a Profiler