NetBeans provides the facilities to profile both local and remote applications. Profiling allows you to get a view of the threads, CPU, and memory usage of your application. This can be very useful when tracking down memory leaks or application bottlenecks that are causing applications to run slowly.
In this recipe, we'll add an extra method to the
Calculator class we defined earlier in this chapter and see how it fares when profiled.
To complete this recipe, you'll need the sample project we created in the earlier recipe, Creating a JUnit test suite. If you have not completed that recipe, the project is available as part of the download bundle for the book.
To profile our application, perform the ...