Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

How to change temp folder for linux agent?

Moderators: Vladimir Kondratyev, Anton Katilin

How to change temp folder for linux agent?

Postby kapliars » Fri Dec 04, 2015 1:02 am

Hello,

I need to profile remote application on rather restricted system, particularly /tmp folder is really tiny. There's not enough space there to keep yourkit agent temp files there, so this leads to error while initializing agent:

5082 53.685: [m: 21623 2654] total classes: processed=9000 instrumented=8997 4551 ms
15082 55.239: F_B_S_W: error: No space left on device

In app err stream I see

[YourKit Java Profiler 2015 build 15082] Log file: /kohls/file/tvs/prof/SystemBoot-48487.log
Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:
/tmp/hsperfdata_appuser/31446
Try using the -Djava.io.tmpdir= option to select an alternate temp location.

15082 0.514: error: agentInit: Core.init() returned false

I've tried providing both dir and logdir options, providing following options

export TMPDIR=/external/prof
java -cp<...> <...GC and JVM options...> -Djava.io.tmpdir=/external/prof -agentpath:/home/appuser/libyjpagent.so=logdir=/external/prof,dir=/external/prof

Unfortunately yourkit agent keeps writing files like /tmp/yjptmp45176_request_buf to the default temporary folder. Is there any way to forward it without changing system-wide tmp folder?
kapliars
 
Posts: 4
Joined: Fri Dec 04, 2015 12:29 am

Re: How to change temp folder for linux agent?

Postby kapliars » Fri Dec 04, 2015 1:18 am

I tried the latest version 15082,

few starting lines from agent log:

15082 0.023: uname:
sysname: Linux
release: 2.6.32-573.7.1.el6.x86_64
version: #1 SMP Thu Sep 10 13:42:16 EDT 2015
machine: x86_64
15082 0.023: Linux; fast_thread_cpu_time=1; 64-bit process
15082 0.023: hid: 3602299949431WWZV5UVYXY7U337612Z75 64-bit machine
15082 0.023: Today is 20151203
15082 0.023: full_build_stamp: 15082 201512021537
15082 0.023: Agent library path: /home/appuser/libyjpagent.so
15082 0.023: Agent_OnLoad: orig_options=logdir=/externtal/prof,dir=/external/prof
full_options=logdir=/external/prof,dir=/external/prof
15082 0.023: phase: 1
15082 0.023: jvmtiVersion: 30010201
15082 0.023: vendor: Oracle Corporation
15082 0.023: version: 24.65-b04
15082 0.023: info: mixed mode, sharing
15082 0.024: session_id: 207684592788405 (1449190325,48355)
15082 0.027: line_method: 1
15082 0.037: Reusing existing jar file: /tmp/yjp201512021537.jar
15082 0.037: JVMTI 30010201; 24.65-b04; Oracle Corporation; mixed mode, sharing; JR=0; I=0
15082 0.064: Successfully registered probe classes: 120
... registered various probes
15082 0.518: shmem 42341490: OK
15082 0.519: shmem 4234148E: OK
15082 0.546: Profiler agent is listening on port 10001
15082 0.550: *** HINT ***: To get profiling results, connect to the application from the profiler UI
15082 0.550: agentInit: Core.init() called
15082 0.551: socket timeout: 30000
15082 0.551: agentInit: OK
15082 0.551: startProfiling: 1
... loading classes and exceptions, and finally
15082 46.755: [m: 21559 2601] total classes: processed=9000 instrumented=8997 4501 ms
15082 114.772: F_B_S_W: error: No space left on device
15082 144.803: SP: pin java.net.SocketTimeoutException
15082 144.805: Exception in dispatchRequest(): java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.$$YJP$$socketRead0(Native Method)
at java.net.SocketInputStream.socketRead0(SocketInputStream.java)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at java.io.DataInputStream.readLong(DataInputStream.java:416)
at com.yourkit.runtime.Packet.readHeader(Packet.java:51)
at com.yourkit.runtime.RequestProcessing.dispatchRequest(RequestProcessing.java:27)
at com.yourkit.runtime.Core$4.run(Core.java:742)
at java.lang.Thread.run(Thread.java:745)
kapliars
 
Posts: 4
Joined: Fri Dec 04, 2015 12:29 am

Re: How to change temp folder for linux agent?

Postby kapliars » Fri Dec 04, 2015 1:19 am

some paths do not exactly match, as I manually substituted them
kapliars
 
Posts: 4
Joined: Fri Dec 04, 2015 12:29 am

Re: How to change temp folder for linux agent?

Postby Anton Katilin » Fri Dec 04, 2015 11:10 am

Please use the agent startup option tmpdir=<your alternate directory>
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: How to change temp folder for linux agent?

Postby kapliars » Fri Dec 04, 2015 7:40 pm

Thanks, the tmpdir option is missing on the options page https://www.yourkit.com/docs/java/help/startup_options.jsp
kapliars
 
Posts: 4
Joined: Fri Dec 04, 2015 12:29 am

Re: How to change temp folder for linux agent?

Postby Anton Katilin » Fri Dec 04, 2015 10:42 pm

We'll add its description, thanks for mentioning.

Did you try this option? Did it solve the problem?
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Majestic-12 [Bot] and 7 guests

cron