2 Replies Latest reply on Jul 25, 2007 1:33 PM by brownfielda

    Memory Leak

    brownfielda

      I've noticed a slight memory leak when coding a portlet using hibernate. Every time I redeploy my portlet about 2Mb more memory is being used by the JVM.

      I was using the ContactPortlet from portletswap as a reference, and found that this also had a memory leak of a smaller size (about .5Mb per deploy).

      I did try some non-hibernate portlets and didn't notice any leaks. I will also try the same set-up on my linux box when I get home to see if I can eliminate Apple's JVM as a problem causer.

      Due to the nature of memory leaks, I'm having difficulty pinpointing what is causing the problem and seeing if anyone has heard of such problems or can recommend some ideas for testing (new to J2EE, so perhaps I'm forgetting some critical method call upon destruction).

      JBoss 2.6 bundled
      Hibernate 3.2.4.sp1
      OS X 10.4.10


      --Andrew

        • 1. Re: Memory Leak
          bdaw

          Its quite well known issue that when you hot redeploy bigger webapp dozen of times you end up with out of memory exception. As far as I remember its related to garbage collection issues with Class class and its more related to Java than AS. Normaly - never use hot redeployment in production and increase heap size during development. Still I'm not saying there can't be any other bug causing memory leak.

          • 2. Re: Memory Leak
            brownfielda

            Thanks for the response.

            The Class class makes sense, since they are used in hibernate and that's where I'm noticing the problems.