I try to use VisualVM to profile my program, but it always crashes with a common same error message:
Waiting... Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15) Profiler Agent: Established connection with the tool Profiler Agent: Local accelerated session Starting test 0
VisualVM manages to give me a very fast snapshot (~ 60 ms), but I'm not sure how reliable such a quick test is.
I followed these instructions but didn’t change anything. I use Java7 anyway, so this is not even a problem.
This is the code I'm trying to profile:
package pathfinderGameTest; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.Deque; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.function.BiConsumer; import utils.Duple; public class Pathfinder<T> {
source share