1

I have an application which runs a rather long analysis (lots of number crunching) so running the application once takes about 3-4 hours, fully utilizing all of the cores. Now I am pretty sure my code is not water-tight so I want to profile and look for potential weak points.

I have been reading quite a bit on jvisualvm, and played around with it a bit too. However it appears as one chooses either cpu or memory profiling, while this article from Javalobby has an interesting quote where the author says:

I realise that both the CPU and Memory Profiling could have been done simultaneously, but for the purpose of this article I wanted to keep them seperate.

Could anyone deny or confirm this? If this is possible it would very useful, so I don't start over and over to profile in different modes. If it's not possible, would it be possible to queue to different profiling analyses so I can run them overnight?

Thanks,

4

2 に答える 2

2

CPUとメモリのプロファイリングを一緒に行うことはできませんが、特に[サンプラー]タブを使用すると、CPUとメモリを非常に簡単に切り替えることができます。あなたの場合、私は単純な監視から始めます。グラフを見ると、メモリに問題があるかどうかがわかるはずです。メモリに問題がある場合は、最初にそれを修正しようとします。それにより、CPUプロファイリングに注意が向けられます。

于 2011-04-05T18:53:44.193 に答える
0

プロファイラーはオブジェクト割り当てのコストを過小評価する傾向があることがわかったので、通常はcpuプロファイリングを使用してメモリプロファイリングを有効にします。これにより、より現実的なCPUプロファイリング結果が得られると思います。(メモリプロファイリングレポートを見なくても)

疑わしい場合は、メモリプロファイリングの有無にかかわらずCPUプロファイルを実行すると、非常に異なる結果が得られる可能性があります。私の経験では、両方の結果を最適化する価値があります。;)

ところで:私はYourKitを使用していますが、この点でVisualVMが大きく異なるとは思いません。

于 2011-04-05T08:43:02.347 に答える