- Download VisualVM https://visualvm.github.io/download.html
- Make sure you have a JDK installed. https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot 2.5 When installing make sure to set the JAVA_HOME option to avoid problems. (that is JDK not JRE, if you do not develop java applications you probably don't have it)
- Make sure your game is in the state you want to analyze.
- Run VisualVM.
- Select the process of your game on the left. (for forge this is usually cpw.mods.modlauncher) See image below
- Go to the Sampler tab
- Wait for the button become valid and click CPU
- VisualVM now samples every thread in your game. Pay special attention to:
- The Server Thread: If the world is laggy or deadlocked this is where to find what it is doing
- The Render Thread: This is your client (doesn't exist for servers). Here you can see what is tanking your FPS.
Optional 9. You can stop sampling and create a snapshot. This snapshot appears on the left and can be saved and send to people who understand what they may be looking at.