Following are quick instructions for offline profiling. For more details, refer to the “JProfiler Manual“.
- Create a JProfile session and configure the triggers. Make sure you add a “save snapshot trigger with a timer”, else you will not get anything. Do this like every 5-10 minutes. You can also give the target snapshot file location when you configure.
- Copy local .jprofiler7/config.xml and JProfiler binaries or agent code to the remote machine
- Add following before the java command.
Here replace the configuration file and JProfiler location with your machine’s values. SESSION_ID is the session ID of the session you created with JProfiler UI. Here ~./jprofiler7/config.xml file has settings for all sessions creates by jprofiler, and it will pick up the right value. If you are profiling in a remote machine copy your local configs to the remote host.
- Start and run the program, and it will print the following
- Open the snapshot file and analyze using JProfiler UI.