1 Reply Latest reply on Sep 19, 2006 4:21 AM by ms2

    VM-Size in Windows task manager increases constantly

    ms2

      I got a big problem. Please give me some hints how to solve it. I read a lot of threads about it here, but no solution.

      My system is:

      P IV, 4GB mem (no swap to not delay the problem)
      Windows 2003 Server x64
      SUN JDK 1.5.0-07 for AMD x64
      JBoss 4.04
      My own stateful session bean and two servlets of my own

      JBoss/JVM parameter:
      set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx2048m
      set JAVA_OPTS=%JAVA_OPTS% -XX:PermSize=150m -XX:NewRatio=3

      My problem is:
      To stress test my bean I create approximately 600 instances. One hour after the start the windows task manager tells me a VM-Size of 2.5 GB. That?s okay. Visual GC 3.0 tells me the following:

      PermSize: 50MB (ok)
      OldGen: 300MB (ok) (after 2 collections)
      Survivor ½: 130MB (ok)
      Eden: 170MB (ok)

      Everything is okay.

      After 30 hours Visual GC:

      PermSize: 50MB (ok)
      OldGen: 300MB (ok) (after 500 collections)
      Survivor ½: 8MB (interesting, but still ok for me)
      Eden: 33MB (interesting, but still ok for me)

      The Problem is now windows task manager for java.exe

      MemUsage: 1.6GB (ok)
      PeakMemIsage: 1.6GB (ok)
      VM Size 3.5GB (and increasing: very big problem)

      When VM-Size reaches 3.8GB, java.exe crashes.

      IMHO JVM?s internal heaps are okay but there must be an internal error in its memory management. It?s not that I want memory returned to the OS but the JVM should detect a lack of fresh memory and not allocate anymore.

      I also think that there is no benefit in changing Xms Xmx Xss (the well known switches). I tried without success.

      Is it possible that this is a special problem of the x64 JVM? With 32 Bit I run onto other limitation.

      Any help is welcome

      Thanks in advance.

        • 1. Re: VM-Size in Windows task manager increases constantly
          ms2

          I found the problem. It's inside the commons-fileupload-1.1.1 library (or my wrong usage of it) which creates a leaking File-Object each time a HTTP-Request is parsed.

          See in DiskFileItem.java:

          public OutputStream getOutputStream() throws IOException
          {
          . if (dfos == null) {
          . . File outputFile = getTempFile();
          . . dfos = new DeferredFileOutputStream(sizeThreshold, outputFile);
          . }
          . return dfos;
          }