Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET Framework.

Working with a service...

Moderators: Vladimir Kondratyev, Anton Katilin

Working with a service...

Postby brownalan » Wed Nov 24, 2004 5:17 pm

I have a java app that is run as a service on a remote machine. I have added -Xrunyjpagent to the command line of the java command that the service invokes. I have confirmed that java -Xrunyjagent:help works ok (I have the dll in my path). However, the service fails to start up when I add the runyjpagent option.

What am I doing wrong? Is there something obvious that I'm missing about how services run (does my regular system path not apply to services?), or does yjp have an issue with services (seems highly unlikely).

Forgive me if the answer to my question is slightly OT (ie. if the answer is regarding paths and services), but I need to fix this asap.

thanks.

alan
brownalan
 
Posts: 2
Joined: Fri Nov 19, 2004 12:13 am

Working with a service

Postby lionel » Tue May 24, 2005 1:46 am

Was there any answer to this question?

I am trying to test an application running in Tomcat. However on the production server it runs as a service.

I did a test on our dev boxes and I can run the agent with Tomcat using the startup script. But if I had the jvm option to the registry and try and start tomcat as a service it fails without a reason why?
lionel
 
Posts: 2
Joined: Tue May 24, 2005 1:42 am

No Answer

Postby lionel » Thu May 26, 2005 11:21 pm

No answer. If it can't run when Tomcat is a service its pretty useless for profiling any applications in a windows production environment. No one is going to running a production application in a console.
Its a shame because real advantage of having a profiler with "zero" overhead would be its ability to be used in production environments without degrading the performance of the server.
lionel
 
Posts: 2
Joined: Tue May 24, 2005 1:42 am

Postby Vladimir Kondratyev » Fri May 27, 2005 5:44 am

Hi Alan,

we are investigating the issue. It looks like yjpagent.dll isn't in the PATH when service starts.

Regards,
Vladimir
Vladimir Kondratyev
 
Posts: 1520
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Postby Anton Katilin » Fri May 27, 2005 7:36 am

1. Please make sure you alter system PATH, not user.

2. Alternatively, if you're running Tomcat with Java 5.0, instead of -agentlib:yjpagent try -agentpath:full_path_to_yjpagent.dll
Anton Katilin
 
Posts: 5967
Joined: Wed Aug 11, 2004 8:37 am

Encountered and Fixed / Bandaided this Issue

Postby mjtrefethen » Sat May 28, 2005 3:23 pm

I encountered this exact same issue attempting to profile a third party vendor's bootstrapped installation of JBoss running Sun 1.4.2 JRE on Windows 2000. The yjpagent.dll was in the system path and I could execute it via command line, obviously using my logged in user path, but the service account could not locate the dll.

With some quick research on how JVMPI loads the agent I found this note :

"The VM attempts to locate a profiler agent library called myprofiler in Java's library directory:

* On Microsoft Windows, it is [value of java.home property]\bin\myprofiler.dll
* On SPARC/Solaris, it is [value of java.home property]/lib/sparc/libmyprofiler.so

If the library is not found in the Java library directory, the VM continues to search for the library following the normal library search mechanism of the given platform:

* On Microsoft Windows, the VM searches the current directory, Windows system directories, and the directories in the PATH environment variable.
* On Solaris, the VM searches the directories in LD_LIBRARY_PATH. "


Since the second option was obviously not working I added a JAVA_HOME parameter to the system and moved the yjpagent.ini and yjpagent.dll into the java/bin folder. This resolved the issue.
mjtrefethen
 
Posts: 1
Joined: Sat May 28, 2005 3:14 pm


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.