Cactus
  1. Cactus
  2. CACTUS-59

CactifyWar task throws OutOfMemory Error with large WAR files

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5-beta1
    • Fix Version/s: None
    • Component/s: Ant Integration
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC

      Description

      When using the CactifyWar task within Ant (v. 1.6), the build will fail with an
      OutOfMemory error. Stack trace follows:

      [cactifywar] Analyzing war: /usr/local/tdk-2.2/webapps/janus/WEB-INF/build/janus.war

      BUILD FAILED
      java.lang.OutOfMemoryError
      at org.apache.tools.ant.Project.executeTarget(Project.java:1246)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:220)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:213)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
      Caused by: java.lang.OutOfMemoryError
      — Nested Exception —
      java.lang.OutOfMemoryError

      Total time: 4 seconds

      ----- End stack trace

      • WAR file size: 44M

      Build fails when Cactified WAR file reaches 9M.

        Activity

        Hide
        Shawn Catoe added a comment -

        I am also encoutering this error. Below are all my stats:
        I am on a PC (WinXP) with 512MB RAM and a 3GB processor.
        I am using ANT 1.6.1 and Cactus 13-1.5 (release 1.5, build 13)
        My war is 22MB before cactify-ing.
        The Java process stays around 18MB until the cactifywar target is called and then the process jumps to about 78MB before dying.

        Exception:
        java.lang.OutOfMemoryError
        at org.apache.tools.ant.Project.executeTarget(Project.java:1224)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
        Caused by: java.lang.OutOfMemoryError

        Show
        Shawn Catoe added a comment - I am also encoutering this error. Below are all my stats: I am on a PC (WinXP) with 512MB RAM and a 3GB processor. I am using ANT 1.6.1 and Cactus 13-1.5 (release 1.5, build 13) My war is 22MB before cactify-ing. The Java process stays around 18MB until the cactifywar target is called and then the process jumps to about 78MB before dying. Exception: java.lang.OutOfMemoryError at org.apache.tools.ant.Project.executeTarget(Project.java:1224) at org.apache.tools.ant.Project.executeTargets(Project.java:1063) at org.apache.tools.ant.Main.runBuild(Main.java:632) at org.apache.tools.ant.Main.startAnt(Main.java:183) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56) Caused by: java.lang.OutOfMemoryError
        Hide
        Catalin Hritcu added a comment -

        I got the same OutOfMemoryError.
        Hardware config: 3GHz, 512MB, WinXP
        Software config: Ant 1.6.4, Cactus 1.7

        I got the following exception when trying to cactify a 24MB war file.

        java.lang.OutOfMemoryError: Java heap space
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
        cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
        Caused by: java.lang.OutOfMemoryError: Java heap space

        I set the "ANT_OPTS" environment variable to "-Xmx256m" and I didn't get the exception any more. At least I tried that once and it worked. Still, a better solution and that would work all the time would be nice.

        Show
        Catalin Hritcu added a comment - I got the same OutOfMemoryError. Hardware config: 3GHz, 512MB, WinXP Software config: Ant 1.6.4, Cactus 1.7 I got the following exception when trying to cactify a 24MB war file. java.lang.OutOfMemoryError: Java heap space at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) at org.apache.tools.ant.Main.startAnt(Main.java:187) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) Caused by: java.lang.OutOfMemoryError: Java heap space I set the "ANT_OPTS" environment variable to "-Xmx256m" and I didn't get the exception any more. At least I tried that once and it worked. Still, a better solution and that would work all the time would be nice.
        Hide
        Magnus Grimsell added a comment -

        I think this should be solved in Cactus 1.8 by the use of cargo 0.8+.

        http://jira.codehaus.org/browse/CARGO-210

        Show
        Magnus Grimsell added a comment - I think this should be solved in Cactus 1.8 by the use of cargo 0.8+. http://jira.codehaus.org/browse/CARGO-210
        Hide
        Petar Tahchiev added a comment -

        Also it could be that your WAR/EAR is really big, so Cactus is
        checking if the needed JARs are in the WEB-INF/lib folder.

        This issue might resolve your problem:
        http://issues.apache.org/jira/browse/CACTUS-258

        It will be included in 1.8.1

        Show
        Petar Tahchiev added a comment - Also it could be that your WAR/EAR is really big, so Cactus is checking if the needed JARs are in the WEB-INF/lib folder. This issue might resolve your problem: http://issues.apache.org/jira/browse/CACTUS-258 It will be included in 1.8.1

          People

          • Assignee:
            Petar Tahchiev
            Reporter:
            brianj
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development