Uploaded image for project: 'JBoss VFS'
  1. JBoss VFS
  2. JBVFS-159

Native memory leak due to ZipEntryInputStream


    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2.GA
    • Fix Version/s: 2.2.3.GA
    • Component/s: None
    • Environment:


      We used to use JBoss 4.2.1.GA and JDK 1.6.0_11, and trying JBoss 5.1.0.GA and JDK 1.6.0_20 these days.
      I found the process size is more larger than before, 2.5G~2.9G compared to 1.9G.
      I was thinking this was a bug of JBoss AS, then filed https://jira.jboss.org/browse/JBAS-8066

      After these days investigation, I think this is a memory leak in VFS, maybe only happen on our specific environment.
      I tried a change on class org.jboss.virtual.plugins.context.zip.ZipFileWrapper, method openStream:
      ZipEntryInputStream zis = new ZipEntryInputStream(this, is);
      return zis;
      //ZipEntryInputStream zis = new ZipEntryInputStream(this, is);
      //return zis;
      return is;

      That is, don't use ZipEntryInputStream, let any class/method invoking openStream to close zipFile's inputStream immediatelly.
      ZipFile will be in open status, but all steams will be closed well.
      This makes the process size down to same as JBoss 4's. I tried going through first 3 pages of site, no problems. May need QA team to test more.

      Btw, I tried updating VFS to 2.1.3.SP1/2.2.0.M4/3.0.0.CR5, first two have same size issue, third one couldn't start.

        Gliffy Diagrams


          1. change.tar.gz
            4 kB
          2. JBVFS-159.patch
            3 kB
          3. leakdetector.jar
            4 kB
          4. test.zip
            6 kB
          5. VFSZipMemoryTestCase.java
            2 kB

            Issue Links



                • Assignee:
                  bmaxwell Brad Maxwell
                  samuel.cai Samuel Cai
                • Votes:
                  2 Vote for this issue
                  11 Start watching this issue


                  • Created: