Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Typically you wouldn't measure these from within the application, but by running another tool on the same host.</p> <p>If you just want to see the impact on the host operating system, you can use a program like <code>top</code> (on *nix boxes), or good old Task Manager on Windows, to see the CPU/memory/IO utilisation of your Java process (typically the servlet container such as Tomcat).</p> <p>If you want more detailed information on the actual Java process itself, you can connect <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html" rel="nofollow noreferrer">JConsole</a> or <a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jvisualvm.html" rel="nofollow noreferrer">jvisualvm</a> to get VM information (including memory and CPU) for the process itself. (With Java 6 you should be able to do this from the local machine without passing any parameters to the Java process at startup; for Java 5, or remote connections, you'll need to pass command-line arguments to the Java process to allow (remote) JMX connections.)</p> <p>Finally, if you want <em>really</em> in-depth details of the resource usage, down to the performance of various methods (which it sounds like you're after), you'll need to use a profiler. There are several of these for Java - with YourKit and JProfiler being the biggest commercial ones (in my unqualified opinion). I believe that the NetBeans IDE also has a decent profiler built-in. The process for connecting these to your application would vary depending on the app itself, but these will all typically allow you to "drill down" into the CPU time to see which classes/methods took the most cycles to execute, and likewise to drill down into memory use to see which classes are taking up the most memory.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload