How do I tell visualvm where to find my source code?

前端 未结 2 677
陌清茗
陌清茗 2020-12-15 18:51

I\'m running VisualVM to profile a simple Java application. When I double-click on a method in the profiling pane (hoping to get more details on it), then it says \"No sourc

2条回答
  •  不思量自难忘°
    2020-12-15 19:32

    Hello something virtually same like VisualVM is implemented in NetBeans IDE (I'm using 8.0.2). You just click Profile->Project Profile. Showing you source code upon clicking is working there. But unfortunately there is no more detailed info which lines of code takes most time.

    For that I will modify code and I will count manually using

    long beg = System.nanoTime() 
    lineISuspect
    sum += System.nanoTime() - beg;
    

提交回复
热议问题