![]() ![]() I generated the examples in this article using the Blackdown port of the JDK 1.3-RC1 for Linux with the following launch command: java -classic -Xrunhprof:heap=sites,cpu=samples,depth=10,monitor=y,thread=y,doe=y MemoryLeak Simply invoke the Java runtime with the following command-line option, as described in the JDK tool documentation for the Java application launcher: java -Xrunhprof MyMainClassĪ list of suboptions is available with the option shown. While not as user-friendly as some commercial tools on the market, hprof is included with the Java 2 JDK and, as I'll demonstrate, can effectively diagnose these behaviors. ![]() Similarly, this article uses the hprof profiling tool to examine three simple control applications that exhibit the three common problem behaviors listed above. This helped me gain confidence in the measurement system I used in experiments that generated less predictable results. When faced with similar problems in my previous incarnation as an experimental physicist, I created control experiments with predictable results. To compound your plight, the data provided by the tools is reasonably complex and the information you are looking at or for is not always clear. But how do you develop confidence in your ability to use these tools effectively? After all, you're using the tools to diagnose complex behavior you don't understand. ![]() Many powerful tools now exist to help us track down the culprits behind those common problems. It's no secret that Java profiling tools have had a long way to catch up to their alternate-language counterparts. They can be particularly daunting in a complex application with multiple threads running through hundreds of thousands of lines of code - an application you can't ship because it grows in memory, becomes inactive, or gobbles up more CPU cycles than it should. Memory leaks and deadlocks and CPU hogs, oh my! Java application developers often face these runtime problems. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |