I am trying to use Jensor in my application and as the manual says, first I have instrumented the code and deployed the code successfully too.
I am facing problem with the 2nd step. WhenI am trying to 'start session' with the default values i.e. ip = localhost & port = 21999, I am getting a message stating that 'There is no Jensor running'.
I was wondering if there is anything else which I needed to do to use Jensor in my application. Could you please help me in this?
Kindly let me know if you have questions for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jensor gets activated only upon first invocation to an instrumented method. You need to ensure that instrumented portion of your application is invoked. Once invoked the JAW i.e. Jensor Analysis Workbench will detect that Jensor is running in context of your application JVM.
For more details refere to Installation Verification section in the Installation manual. A step-by-step how to is provided to enable Jensor to profile data from a sample application.
Finally, IP should be the ip of the machine where your instrumented code is running not where Jensor UI i.e. JAW is running.
Pls. go through mentioned documentation and let know if you need help.
HTH,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-18
Hi Amol,
Thanks for the reply. Actually I've instrumented complete EAR file and deployed it to our JBOSS Server so I have strong feeling that JAW should have been called automatically but this is not the case.
Anything else you would like to suggest?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On the JBoss machine, Jensor should be installed. Ensure that you have Jensor installed on your JBoss machined too.
If entire EAR is instrumented, just invoke some methods by accessing an application URL. Once Jensor is activated you will see some SOPs in JBoss console logs. If you see them you know Jensor has been activated. Once active Jensor starts writing profiling data to $JENSOR_HOME/output folder. Here you should see a couple of .txt and .csv files being written to. Once you see this, open JAW on you client machine and point it to JBoss Ip at 21999. When Jensor is running you should not get the message you are getting.
Also, there are a couple of rudimentary security settings. The machine where your JAW is located needs to be in trusted list of Jensor which is running on your JBoss machine. Take a look at security sections in usage manual to find out out JAW can pull data from a remote server running Jensor.
Ciao,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-18
Amol,
Thanks.. this is working fine now. I figured out that Jensar was not instrumenting the complete ear file (don't know why), so I have instrumented a war file in it and as soon as I have started the application, session automatically got started and after collating records, I was able to see the different methods using the memory.
But I am still not able to see 'System Metrics' and by clicking on it I am getting a message as 'Files for system utilization not found'… Actually I need to analyze the memory usage especially the server sessions as we feel we have added loads of things into the session.
Any suggestions?
Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Glad to know, its working for you now. If you can repeatably reproduce the condition you can file a bug on Jensor forum and we will take a look at it.
As far as System Utilization is concerned, it is turned off by default. You need to enable it in Jensor.properties under $JENSOR-HOME/config. Upon next reboot of JBoss Jensor will start reporting system metrics. Usage manual has all the required info.
Also, System Utilization is for the entire system not just for JBoss JVM process. On Unix platforms it uses sar and on Windows it uses typeperf utilities to collect this data. Ensure that you have permission to run these utilities under the login which starts JBoss.
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-18
Thanks a ton, Amol!
It worked out perfectly now and let me tell you that its a great tool for analyzing method calls and response times. Pretty cool!
But I was wondering if Jensar tells the details of the objects also which are consuming memory? I can see that there is one 'object instantiation' action but even that does not tell the memory details about variables/objects viz session variable.
Any idea how can I achieve that? or could you please suggest me any other utility for finding the same?
Regards,
Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem with Java is that there is no sizeof operator like in Java so reporting Object sizes in bytes using Bytecode instrumentation (that Jensor uses) is difficult. Hence it is kind of leftout here. The Object Instantiation module does tell you which object got allocated in which module, when and how many times.
If you do need to peep inside your HTTP Sessions, there are a couple of options :
1) Theses days every app server provides a way to see session details. Tomcat 6.X onwards its there. So i guess JBoss should also have it.
2) Another tool than claims to be very good at Session Management is MessAdmin. Never got a chance to use it though.
Ciao,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-18
Hi Amol,
Did you guys try to use Java 1.5's java.lang.instrument.Instrumentation which has a getObjectSize()? was wondering if that is helpful.
We dont use the Instrumentation API because we still wish to support JDK 1.4. Still quite a few applications there.
Jensor 2.x series will be JDK 1.5 based. May be we will use Instrumentation API there.
On a side note, try out Jensor's Tagging feature. Let me know how you find it.
-Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-19
Thats understandable coz even we are on Java 1.5 and were looking for some java profiler which can help us in analyzing our application. (and we found out that many of the online available profilers support java 1.6 and not 1.5)
Amol, would have to trouble you again for a thing.
Can we install jensor on a linux system?
or
can we use Jensor in profiling a remote application? If yes then how?
Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jensor is written 100% in Java so you can install on Linux and use X Windows to get the Jensor UI to work or export DISPLAY to Windows machine
OR
Sitting on your Windows JAW you can connect to remote Linux server and pull data (collate) to your Windows JAW and analyze it locally.
- Cheers
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-20
Amol,
I am trying the second strategy and while starting jboss I am getting following error in jboss console.
2010-10-20 11:47:43,284 INFO Finding Platform info …
2010-10-20 11:47:43,284 INFO Current platform is Linux
2010-10-20 11:47:43,284 INFO Executing Shell Command
2010-10-20 11:47:45,315 ERROR java.io.FileNotFoundException: /config/Jensor.properties (No such file or directory)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.open(Native Method)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.<init>(FileInputStream.java:106)
Is there some problem with setting the JENSOR_HOME? could you let me know in which file I need to set it.? I have added this key/value pair in /etc/profile file.
Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes Pankaj, you got it right. You are getting this error because $JENSOR_HOME is not setup correctly.
set this value in your .bash_profile if you are using bash shell to start JBOSS. If your default shell is C shell you will have to add it to .profile.
Once you add JENSOR_HOME to the right file, do not forget to execute the them or simply logoff and login again and then restart your JBOSS.
-Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-22
Amol,
I am still getting the same error though I've checked that JENSOR_HOME is set properly:
echo $JENSOR_HOME
/u01/iAnalyze/Jensor/Jensor
I have extracted jensor's unix distribution into this path and copied the instrumented ear into jboss's deploy folder. Same thing I did successfully in windows. but here in the logs I am getting this error..
2010-10-20 11:47:43,284 INFO Finding Platform info …
2010-10-20 11:47:43,284 INFO Current platform is Linux
2010-10-20 11:47:43,284 INFO Executing Shell Command
2010-10-20 11:47:45,315 ERROR java.io.FileNotFoundException: /config/Jensor.properties (No such file or directory)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.open(Native Method)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.<init>(FileInputStream.java:106)
Not sure what is causing this now..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jensor looks for JENSOR_HOME property using System.getProperty("JENSOR_HOME") call. When you set it up at OS level in bash or default shell script level, JBoss should be able to pick up the value.
In your case it looks like it does JBoss is not getting that environment variable. now you have 3 options
1) Edit JBoss startup script and enter value for JENSOR_HOME there.
2) if JBoss allows you to define environment variables, create a variable called JENSOR_HOME
3) Add -DJENSOR_HOME=/u01/iAnalyze/Jensor/Jensor to the command in which launches JBoss.
-Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Already tried that also.. :(
and JENSOR_HOME=/u01/iAnalyze/Jensor/Jensor is coming there too :(
-Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-10-22
One confusion?
Why I need to extract Jensor's unix distribution on unix platform when I want to use windows JAW and want to remotely analyze the instrumented application running on Unix?
Why we need to set JENSOR_HOME? It should not be connected with deployment of the application. I should be able to deploy my instrumented EAR without jensor.properties. JAW should use this file.
Could be i am talking gibberish.. do let me know in case of any questions.. correct me if u understand it and if i am wrong.
-Pankaj Upadhyay
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
JAW acts only as a client to Jensor. It is just a presentation tier right now.
Jensor installation creates a directory structure where it starts writing data files. Through JAW we just connect to Jensor on the remote machine and pull the data to the machine where JAW is installed. Currently Jensor does not support the push mechanism i.e. you cannot push a config.properties from your JAW machine to your remote machine. If Jensor had to start by reading property files / configuration files on JAW machine its startup time would be very high. So the application would start slowly.
May be in future we may support pushing Jensor folder structure and necessary files from JAW machine to remote machine so that no *installation* is necessary on the remote.
Why dont you put in a Feature Request for the same?
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to instrument a ear file but when I have to select the classes to instrument nothing s displayed, what possibly might be wrong, can anyone help me on this?
Bhoomi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi There,
I am trying to use Jensor in my application and as the manual says, first I have instrumented the code and deployed the code successfully too.
I am facing problem with the 2nd step. WhenI am trying to 'start session' with the default values i.e. ip = localhost & port = 21999, I am getting a message stating that 'There is no Jensor running'.
I was wondering if there is anything else which I needed to do to use Jensor in my application. Could you please help me in this?
Kindly let me know if you have questions for me.
Hi,
Jensor gets activated only upon first invocation to an instrumented method. You need to ensure that instrumented portion of your application is invoked. Once invoked the JAW i.e. Jensor Analysis Workbench will detect that Jensor is running in context of your application JVM.
For more details refere to Installation Verification section in the Installation manual. A step-by-step how to is provided to enable Jensor to profile data from a sample application.
Finally, IP should be the ip of the machine where your instrumented code is running not where Jensor UI i.e. JAW is running.
Pls. go through mentioned documentation and let know if you need help.
HTH,
Amol
Hi Amol,
Thanks for the reply. Actually I've instrumented complete EAR file and deployed it to our JBOSS Server so I have strong feeling that JAW should have been called automatically but this is not the case.
Anything else you would like to suggest?
Hi,
On the JBoss machine, Jensor should be installed. Ensure that you have Jensor installed on your JBoss machined too.
If entire EAR is instrumented, just invoke some methods by accessing an application URL. Once Jensor is activated you will see some SOPs in JBoss console logs. If you see them you know Jensor has been activated. Once active Jensor starts writing profiling data to $JENSOR_HOME/output folder. Here you should see a couple of .txt and .csv files being written to. Once you see this, open JAW on you client machine and point it to JBoss Ip at 21999. When Jensor is running you should not get the message you are getting.
Also, there are a couple of rudimentary security settings. The machine where your JAW is located needs to be in trusted list of Jensor which is running on your JBoss machine. Take a look at security sections in usage manual to find out out JAW can pull data from a remote server running Jensor.
Ciao,
Amol
Amol,
Thanks.. this is working fine now. I figured out that Jensar was not instrumenting the complete ear file (don't know why), so I have instrumented a war file in it and as soon as I have started the application, session automatically got started and after collating records, I was able to see the different methods using the memory.
But I am still not able to see 'System Metrics' and by clicking on it I am getting a message as 'Files for system utilization not found'… Actually I need to analyze the memory usage especially the server sessions as we feel we have added loads of things into the session.
Any suggestions?
Pankaj
Hi Pankaj,
Glad to know, its working for you now. If you can repeatably reproduce the condition you can file a bug on Jensor forum and we will take a look at it.
As far as System Utilization is concerned, it is turned off by default. You need to enable it in Jensor.properties under $JENSOR-HOME/config. Upon next reboot of JBoss Jensor will start reporting system metrics. Usage manual has all the required info.
Also, System Utilization is for the entire system not just for JBoss JVM process. On Unix platforms it uses sar and on Windows it uses typeperf utilities to collect this data. Ensure that you have permission to run these utilities under the login which starts JBoss.
Amol
Thanks a ton, Amol!
It worked out perfectly now and let me tell you that its a great tool for analyzing method calls and response times. Pretty cool!
But I was wondering if Jensar tells the details of the objects also which are consuming memory? I can see that there is one 'object instantiation' action but even that does not tell the memory details about variables/objects viz session variable.
Any idea how can I achieve that? or could you please suggest me any other utility for finding the same?
Regards,
Pankaj
Thanks for your feedback! Appreciate it.
The problem with Java is that there is no sizeof operator like in Java so reporting Object sizes in bytes using Bytecode instrumentation (that Jensor uses) is difficult. Hence it is kind of leftout here. The Object Instantiation module does tell you which object got allocated in which module, when and how many times.
If you do need to peep inside your HTTP Sessions, there are a couple of options :
1) Theses days every app server provides a way to see session details. Tomcat 6.X onwards its there. So i guess JBoss should also have it.
2) Another tool than claims to be very good at Session Management is MessAdmin. Never got a chance to use it though.
Ciao,
Amol
Hi Amol,
Did you guys try to use Java 1.5's java.lang.instrument.Instrumentation which has a getObjectSize()? was wondering if that is helpful.
http://download-llnw.oracle.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html
Hi Pankaj,
We dont use the Instrumentation API because we still wish to support JDK 1.4. Still quite a few applications there.
Jensor 2.x series will be JDK 1.5 based. May be we will use Instrumentation API there.
On a side note, try out Jensor's Tagging feature. Let me know how you find it.
-Amol
Thats understandable coz even we are on Java 1.5 and were looking for some java profiler which can help us in analyzing our application. (and we found out that many of the online available profilers support java 1.6 and not 1.5)
Amol, would have to trouble you again for a thing.
Can we install jensor on a linux system?
or
can we use Jensor in profiling a remote application? If yes then how?
Pankaj
Hi Pankaj,
You can do both.
Jensor is written 100% in Java so you can install on Linux and use X Windows to get the Jensor UI to work or export DISPLAY to Windows machine
OR
Sitting on your Windows JAW you can connect to remote Linux server and pull data (collate) to your Windows JAW and analyze it locally.
- Cheers
Amol
Amol,
I am trying the second strategy and while starting jboss I am getting following error in jboss console.
2010-10-20 11:47:43,284 INFO Finding Platform info …
2010-10-20 11:47:43,284 INFO Current platform is Linux
2010-10-20 11:47:43,284 INFO Executing Shell Command
2010-10-20 11:47:45,315 ERROR java.io.FileNotFoundException: /config/Jensor.properties (No such file or directory)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.open(Native Method)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.<init>(FileInputStream.java:106)
Is there some problem with setting the JENSOR_HOME? could you let me know in which file I need to set it.? I have added this key/value pair in /etc/profile file.
Pankaj
Yes Pankaj, you got it right. You are getting this error because $JENSOR_HOME is not setup correctly.
set this value in your .bash_profile if you are using bash shell to start JBOSS. If your default shell is C shell you will have to add it to .profile.
Once you add JENSOR_HOME to the right file, do not forget to execute the them or simply logoff and login again and then restart your JBOSS.
-Amol
Amol,
I am still getting the same error though I've checked that JENSOR_HOME is set properly:
echo $JENSOR_HOME
/u01/iAnalyze/Jensor/Jensor
I have extracted jensor's unix distribution into this path and copied the instrumented ear into jboss's deploy folder. Same thing I did successfully in windows. but here in the logs I am getting this error..
2010-10-20 11:47:43,284 INFO Finding Platform info …
2010-10-20 11:47:43,284 INFO Current platform is Linux
2010-10-20 11:47:43,284 INFO Executing Shell Command
2010-10-20 11:47:45,315 ERROR java.io.FileNotFoundException: /config/Jensor.properties (No such file or directory)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.open(Native Method)
2010-10-20 11:47:45,316 ERROR at java.io.FileInputStream.<init>(FileInputStream.java:106)
Not sure what is causing this now..
Jensor looks for JENSOR_HOME property using System.getProperty("JENSOR_HOME") call. When you set it up at OS level in bash or default shell script level, JBoss should be able to pick up the value.
In your case it looks like it does JBoss is not getting that environment variable. now you have 3 options
1) Edit JBoss startup script and enter value for JENSOR_HOME there.
2) if JBoss allows you to define environment variables, create a variable called JENSOR_HOME
3) Add -DJENSOR_HOME=/u01/iAnalyze/Jensor/Jensor to the command in which launches JBoss.
-Amol
ps aux | grep java
pankaj 20844 32.6 5.0 1625016 418628 pts/0 Sl 15:02 2:52 /home/iAnalyze/jdk1.5.0_12/bin/java -Xms128M -Xmx700M -DJbossname=jboss_48080_Itr10 -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+UseConcMarkSweepGC -XX:+UseConcMarkSweepGC -Dprogram.name=run.sh -server -Xms128M -Xmx1024M -XX:MaxPermSize=128M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -DENVIRONMENT_SETTINGS_PROPS=/home/iAnalyze/Config_48080_Itr10/EnvironmentSettings.properties -Djava.io.tmpdir=/home/iAnalyze/logs/log_48080/temp -DWEB_FORM=/home/iAnalyze/jboss_48080_Itr10/webform.properties -DJENSOR_HOME=/u01/iAnalyze/Jensor/Jensor -Djava.endorsed.dirs=/home/iAnalyze/jboss_48080_Itr10/lib/endorsed -classpath /home/iAnalyze/jboss_48080_Itr10/bin/run.jar::/home/iAnalyze/Config_48080_Itr10/ConfigFiles/:/home/iAnalyze/jdk1.5.0_12/lib/tools.jar org.jboss.Main -b 0.0.0.0
Already tried that also.. :(
and JENSOR_HOME=/u01/iAnalyze/Jensor/Jensor is coming there too :(
-Pankaj
One confusion?
Why I need to extract Jensor's unix distribution on unix platform when I want to use windows JAW and want to remotely analyze the instrumented application running on Unix?
Why we need to set JENSOR_HOME? It should not be connected with deployment of the application. I should be able to deploy my instrumented EAR without jensor.properties. JAW should use this file.
Could be i am talking gibberish.. do let me know in case of any questions.. correct me if u understand it and if i am wrong.
-Pankaj Upadhyay
Pankaj,
JAW acts only as a client to Jensor. It is just a presentation tier right now.
Jensor installation creates a directory structure where it starts writing data files. Through JAW we just connect to Jensor on the remote machine and pull the data to the machine where JAW is installed. Currently Jensor does not support the push mechanism i.e. you cannot push a config.properties from your JAW machine to your remote machine. If Jensor had to start by reading property files / configuration files on JAW machine its startup time would be very high. So the application would start slowly.
May be in future we may support pushing Jensor folder structure and necessary files from JAW machine to remote machine so that no *installation* is necessary on the remote.
Why dont you put in a Feature Request for the same?
Amol
Hi,
I tried to instrument a ear file but when I have to select the classes to instrument nothing s displayed, what possibly might be wrong, can anyone help me on this?
Bhoomi