Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (7k points)

I downloaded the trial version YourKit Java Profiler for Linux and testing in my AWS instance.

I am trying to Enabling profiling manually by the following steps,(-agentpath:/home/yourkit/yjp-2015-build-15078/bin/linux-x86-64/libyjpagent.so)

I am getting the following error,

Error: What I am getting:

[YourKit Java Profiler 2015 build 15078] Cannot create log file: /home/ubuntu/.yjp/log/java-1884.log To specify alternate log directory use startup option 'logdir' 15078 0.000: Command line: java -agentpath:/home/yourkit/yjp-2015-build-15078/bin/linux-x86-64/libyjpagent.so 15078 0.000: Executable: /usr/lib/jvm/java-8-oracle/jre/bin/java 15078 0.000: uname: sysname: Linux release: 3.13.0-48-generic version: #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 machine: x86_64 15078 0.000: Linux; fast_thread_cpu_time=1; 64-bit process 15078 0.001: hid: 36022997176V9ZXX3UXV5UWZ513Z98931W 64-bit machine 15078 0.001: Today is 20151201 15078 0.001: full_build_stamp: 15078 201511161426 15078 0.001: Agent library path: /home/yourkit/yjp-2015-build-15078/bin/linux-x86-64/libyjpagent.so 15078 0.001: Agent_OnLoad: orig_options= full_options= 15078 0.001: phase: 1 15078 0.001: jvmtiVersion: 30010203 15078 0.001: vendor: Oracle Corporation 15078 0.001: version: 25.66-b17 15078 0.001: info: mixed mode, sharing 15078 0.001: Java 8 detected 15078 0.001: session_id: 8093167346477 (1448960813,1884) 15078 0.003: line_method: 1 15078 0.008: Reusing existing jar file: /tmp/yjp201511161426.jar 15078 0.008: JVMTI 30010203; 25.66-b17; Oracle Corporation; mixed mode, sharing; JR=0; I=0 15078 0.025: Successfully registered probe classes: 120 Registered: .AWTEvents$EventQueue_dispatchEvent_Probe Registered: .AgentLoadingSupport$JBoss Registered: .AgentLoadingSupport$OSGi1 Registered: .AgentLoadingSupport$OSGi2 Registered: .AgentLoadingSupport$OSGi3 Registered: .Databases$Connection_close_Probe Registered: .Databases$Connection_createStatement_Probe Registered: .Databases$Connection_prepareStatement_Probe Registered: .Databases$DataSource_getConnection_Probe Registered: .Databases$DataSource_setName_Probe Registered: .Databases$DriverManager_getConnection_Probe Registered: .Databases$Driver_connect_Probe Registered: .Databases$InitialContext_lookup_Probe Registered: .Databases$PooledConnection_getConnection_Probe Registered: .Databases$PreparedStatement_addBatch_Probe Registered: .Databases$PreparedStatement_clearBatch_Probe Registered: .Databases$PreparedStatement_execute_Probe Registered: .Databases$Statement_addBatch_Probe Registered: .Databases$Statement_clearBatch_Probe Registered: .Databases$Statement_close_Probe Registered: .Databases$Statement_executeBatch_Probe Registered: .Databases$Statement_execute_Probe Registered: .DatabasesLW$Connection_close_Probe Registered: .DatabasesLW$Connection_createStatement_Probe Registered: .DatabasesLW$Connection_prepareStatement_Probe Registered: .DatabasesLW$DataSource_getConnection_Probe Registered: .DatabasesLW$DriverManager_getConnection_Probe Registered: .DatabasesLW$Driver_connect_Probe Registered: .DatabasesLW$PooledConnection_getConnection_Probe Registered: .DatabasesLW$PreparedStatement_execute_Probe Registered: .DatabasesLW$Statement_close_Probe Registered: .DatabasesLW$Statement_execute_Probe1 Registered: .DatabasesLW$Statement_execute_Probe2 Registered: .Files$FileChannel_read_Probe Registered: .Files$FileChannel_write_Probe Registered: .Files$FileInputStream_close_Probe Registered: .Files$FileInputStream_open_Probe Registered: .Files$FileInputStream_readBytes_Probe Registered: .Files$FileInputStream_read_Probe Registered: .Files$FileOutputStream_close_Probe Registered: .Files$FileOutputStream_open_Probe Registered: .Files$FileOutputStream_writeBytes_Probe Registered: .Files$FileOutputStream_write_Probe Registered: .Files$GetChannel_Probe Registered: .Files$RandomAccessFile_close_Probe Registered: .Files$RandomAccessFile_open_Probe Registered: .Files$RandomAccessFile_readBytes_Probe Registered: .Files$RandomAccessFile_read_Probe Registered: .Files$RandomAccessFile_writeBytes_Probe Registered: .Files$RandomAccessFile_write_Probe Registered: .FilesLW$FileChannelsTelemetry$FileChannel_read_Probe Registered: .FilesLW$FileChannelsTelemetry$FileChannel_write_Probe Registered: .FilesLW$FileChannelsTelemetry$GetChannel_Probe Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_close_Probe Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_open_Probe Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_readBytes_Probe Registered: .FilesLW$FileStreamsTelemetry$FileInputStream_read_Probe Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_close_Probe Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_open_Probe Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_writeBytes_Probe Registered: .FilesLW$FileStreamsTelemetry$FileOutputStream_write_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_close_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_open_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_readBytes_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_read_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_writeBytes_Probe Registered: .FilesLW$RandomAccessFilesTelemetry$RandomAccessFile_write_Probe Registered: .JNDI$DirContext_1 Registered: .JNDI$DirContext_2 Registered: .JNDI$NamingContext_1 Registered: .JNDI$NamingContext_2 Registered: .JUnitTests$Old_Run_Probe Registered: .JUnitTests$Old_SetUp_Probe Registered: .JUnitTests$Old_TearDown_Probe Registered: .JUnitTests$Run_Probe Registered: .JUnitTests$SetUp_Probe Registered: .JUnitTests$TearDown_Probe Registered: .Processes$FileOutputStream_writeBytes_Probe Registered: .Processes$FileOutputStream_write_Probe Registered: .Processes$InputStream_readBytes_Probe Registered: .Processes$InputStream_read_Probe Registered: .Processes$ProcessImpl_getErrorStream_Probe Registered: .Processes$ProcessImpl_getInputStream_Probe Registered: .Processes$ProcessImpl_getOutputStream_Probe Registered: .Processes$ProcessImpl_start_Probe Registered: .Processes$ProcessImpl_waitFor_Probe Registered: .Processes$UnixProcess_waitForProcessExit_Probe Registered: .Servlets$Filter_doFilter_Probe Registered: .Servlets$HttpJspPage_jspService_Probe Registered: .Servlets$Servlet_service_Probe Registered: .ServletsLW$Filter_doFilter_Probe Registered: .ServletsLW$HttpJspPage_jspService_Probe Registered: .ServletsLW$Servlet_service_Probe Registered: .Sockets$ServerSocketChannel_accept_Probe Registered: .Sockets$ServerSocket_accept_Probe Registered: .Sockets$SocketChannel_close_Probe Registered: .Sockets$SocketChannel_connect_Probe Registered: .Sockets$SocketChannel_read_Probe Registered: .Sockets$SocketChannel_write_Probe Registered: .Sockets$SocketInputStream_read_Probe Registered: .Sockets$SocketOutputStream_write_Probe Registered: .Sockets$Socket_close_Probe Registered: .Sockets$Socket_connect_Probe Registered: .Sockets$Socket_getInputStream_Probe Registered: .Sockets$Socket_getOutputStream_Probe Registered: .SocketsLW$ServerSocketChannel_accept_Probe Registered: .SocketsLW$ServerSocket_accept_Probe Registered: .SocketsLW$SocketChannel_close_Probe Registered: .SocketsLW$SocketChannel_connect_Probe Registered: .SocketsLW$SocketChannel_read_Probe Registered: .SocketsLW$SocketChannel_write_Probe Registered: .SocketsLW$SocketInputStream_read_Probe Registered: .SocketsLW$SocketOutputStream_write_Probe Registered: .SocketsLW$Socket_close_Probe Registered: .SocketsLW$Socket_connect_Probe Registered: .TestNG$Test_Probe Registered: .Threads$Thread_constructor_Probe Registered: .Threads$Thread_run_Probe Registered: .Threads$Thread_setName_Probe Registered: .Threads$Thread_start_Probe 15078 0.089: agentStart: 1 15078 0.089: agentStart: 2 15078 0.090: agentStart: OK 15078 0.106: tracing=off: large method: 3945 sun.nio.cs.StandardCharsets$Aliases.init(java.lang.Object[]) 15078 0.211: agentInit: 1 15078 0.212: agentInit: Core loaded 15078 0.216: setTriggers: 15078 0.277: setTriggers: to unregister: 0 15078 0.277: setTriggers: method listeners to register: 0 15078 0.277: setTriggers: OK 15078 0.277: ourUnsafe: true 15078 0.277: shmem 42341490: OK 15078 0.277: shmem 4234148E: OK 15078 0.298: Profiler agent is listening on port 10001 15078 0.301: * HINT *: To get profiling results, connect to the application from the profiler UI 15078 0.301: agentInit: Core.init() called 15078 0.301: agentInit: OK 15078 0.302: startProfiling: 1 15078 0.302: startProfiling: OK 15078 0.302: socket timeout: 30000 15078 0.358: SP: pin java.io.FileNotFoundException 15078 0.358: SP: pin java.security.PrivilegedActionException 15078 0.399: SP: pin java.lang.ClassNotFoundException 15078 0.432: tracing=off: large method: 4108 sun.text.resources.FormatData.getContents() 15078 0.455: SP: pin java.lang.NoSuchFieldException 15078 0.473: tracing=off: large method: 8578 sun.util.resources.CurrencyNames.getContents() Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the "server" VM The default VM is server, because you are running on a server-class machine. -cp -classpath A : separated list of directories, JAR archives, and ZIP archives to search for class files. -D= set a system property -verbose:[class|gc|jni] enable verbose output -version print product version and exit -version: Warning: this feature is deprecated and will be removed in a future release. require the specified version to run -showversion print product version and continue -jre-restrict-search | -no-jre-restrict-search Warning: this feature is deprecated and will be removed in a future release. include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:...|:] -enableassertions[:...|:] enable assertions with specified granularity -da[:...|:] -disableassertions[:...|:] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:[=] load native agent library , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:[=] load native agent library by full pathname -javaagent:[=] load Java programming language agent, see java.lang.instrument -splash: show splash screen with specified image See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details. 15078 0.492: vmDeath: 1 15078 0.492: vmDeath: 2 15078 0.492: vmDeath: 3 15078 0.492: vmDeath: 4 15078 0.492: vmDeath: OK

Here are my questions:

1. Need Installation steps Yourkit Java Profiling for JVM - Ubuntu.

2. How to connect through remote.

1 Answer

0 votes
by (13.1k points)

Read the output

[YourKit Java Profiler 2015 build 15078] Cannot create log file: /home/ubuntu/.yjp/log/java-1884.log To specify alternate log directory use startup option 'logdir'

According to your log files, it looks like the user who is running the java process does not have the access to write on your /home/ubuntu/.yjp/log/ folder.

Grant access to your user, restart your application and check if it works.

How to monitor a remote application

For remote profiling, start your JVM with the profiler agent as you did locally on your AWS server and when the remote application is running, connect to it from the profiler UI to perform profiling.

In some cases you will have  to unable manual profiling by running a server agent.

Want to learn Java? Check out the Java certification from Intellipaat.

Browse Categories

...