CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE (Cool web site)
CHAPTER 14 SOLVING COMMON JAVA EE PERFORMANCE PROBLEMS what requests you need to look at inside a memory profiler. Finding memory leaks in a production environment without crashing your application server is tricky, but tools with these monitoring capabilities make your job much easier! Artificial Memory Leaks A few issues can appear to be memory leaks that in actuality are not. I refer to these as artificial memory leaks, and they may appear in the following situations: Premature analysis Leaky sessions Permanent space anomalies This section examines each artificial memory leak, describing how to detect it and how to work around it. Premature Analysis To avoid a false positive when searching for memory leaks, you need to ensure that you are observing and analyzing the heap at the appropriate time. The danger is that, because a certain number of long-lived objects need to be in the heap, a trend may look deceiving until the heap reaches a steady state and contains its core objects. Wait until your application reaches this steady state prior to performing any trend analysis on the heap. To detect whether or not you are analyzing the heap prematurely, continue monitoring it after your analysis snapshot for a couple hours to see if the upward heap trend levels off or if it continues upward indefinitely. If the trend levels off, then capture a new memory recording at this point. If the trend continues upward, then analyze the memory session you have. Leaky Sessions Memory leaks tend to occur during Web requests, but during a Web request objects can be stored only in a finite number of places. Those places include the following: Page scope Request scope Session scope Application scope Static variables Long-lived class variables, such as inside a servlet itself When implementing JSPs, any variable created inside the JSP itself will be eligible for garbage collection as soon as the page completes; these variables exist for the lifetime of a single page. Attributes and parameters that are passed from the Web server to the application server, as well as attributes that are passed between servlets and JSPs, live inside an HttpServletRequest
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.