Using the Profiler (available on local GlassFish domains and JVMs) adversely affects performance of the profiled application. When profiling is started, the profiled application is suspended while profiling instrumentation is enabled, and when profiling is stopped, the profiled application is again suspended while profiling instrumentation is disabled. While profiling is active, performance of the profiled application is reduced.
Workaround: None. Using the Profiler is not advised on production servers. For preproduction and development systems, here are some tips:
If you want to profile a web application (not the entire server), use the NetBeans Profiler with its GlassFish integration instead of the Profiler in Performance Monitor. The NetBeans Profiler automatically constrains the profiling instrumentation to the application, so overall server performance is not as greatly affected.
If you need to profile the server, try to define small rootsets (method entry points) so that only parts of the server get instrumented for profiling. Also, make as much memory and CPU time as possible available to the profiled server and to Performance Monitor.