profiler command tool

Questions about YourKit Java Profiler
Post Reply
kyip1011
Posts: 4
Joined: Tue Oct 26, 2021 1:20 pm

profiler command tool

Post by kyip1011 »

I am trying to use the Profiler command tool (version YourKit-JavaProfiler-2021.3) because I am running in a headless environment. When I use the capture-performance-snapshot command, it finished with something like:

Snapshot captured: /tmp/prpc-2021-10-26-9.snapshot

However, the file does not exist. I believe it is because there is insufficient disk space in the /tmp disk volume. I am struggling to override the snapshot directory. I tried many ways such as:
- <user home>/.yjp/snapshotdir.txt
- <user home>/.yip/ui.ini. with -Dyk.tmp.dir=/local/ky/tmp

None of them changes the default snapshot directory. Can you help?

Thanks.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: profiler command tool

Post by Anton Katilin »

The snapshot directory customization is described in https://www.yourkit.com/docs/java/help/snapshot_dir.jsp
- <user home>/.yjp/snapshotdir.txt
Please check the user home is correct.
- <user home>/.yip/ui.ini. with -Dyk.tmp.dir=/local/ky/tmp
This setting is irrelevant. It's for loading snapshots, not creating.

Please try the agent startup option "dir=/your/dir".
https://www.yourkit.com/docs/java/help/ ... ptions.jsp
kyip1011
Posts: 4
Joined: Tue Oct 26, 2021 1:20 pm

Re: profiler command tool

Post by kyip1011 »

I added some disk to the /tmp volume. The snapshot file still does not exist. It sounds like something else. Any suggestion?
kyip1011
Posts: 4
Joined: Tue Oct 26, 2021 1:20 pm

Re: profiler command tool

Post by kyip1011 »

"Please check the user home is correct." It is the same one I found the ui.ini file:

h-4.2$ pwd
/home/ssm-user/.yjp
sh-4.2$ ls -al
total 20
drwxr-xr-x 3 ssm-user ssm-user 4096 Oct 26 15:06 .
drwx------ 3 ssm-user ssm-user 4096 Oct 26 01:53 ..
drwxr-xr-x 2 ssm-user ssm-user 4096 Oct 26 15:23 log
-rw-r--r-- 1 ssm-user root 14 Oct 26 02:05 snapshotdir.txt
-rw-r--r-- 1 ssm-user ssm-user 1001 Oct 26 13:06 ui.ini

Anyway, I added disk to /tmp and the snapshot still does not exist...
kyip1011
Posts: 4
Joined: Tue Oct 26, 2021 1:20 pm

Re: profiler command tool

Post by kyip1011 »

I found the snapshot files. They are in the /tmp of host where the remote application runs.

This behavior is different than what is observed if I was running the Profiler GUI. The snapshots are where the Profiler GUI is. So, the GUI actually takes care of moving those files from the profiled app machine? Or, this behavior is specific to command tool?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: profiler command tool

Post by Anton Katilin »

Yes, the command line tool creates snapshots in the file system of the profiled application.

Please see the last section:
https://www.yourkit.com/docs/java/help/snapshot_dir.jsp

When you use the UI, it creates a performance snapshot directly on your local machine and automatically copies a memory snapshot to your local machine.
Post Reply