You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by brian janaszek <bj...@collaborativefusion.com> on 2003/10/07 16:23:23 UTC

OutOfMemory Error and CactifyWar...

Hi--

I've been developing a testing framework for our web application (the
app uses Turbine 2.2/Torque 3.1 as a its framework), and I've finally
settled on Cactus for a testing framework.  Here's a brief overview of
the system...

Linux (RedHat 8)
Turbine 2.2 (Tomcat 4.x)
Ant 1.6 (built from source)

Until this morning, I was able to successfully run basic Cactus tests on
my machine.  Then, after modifying a test class, I ran my compile target
(which also generates a WAR file) and my unit-tests target (which uses
the Ant <cactus> and <cactifywar> tasks), and once the classes were
compiled and the WAR generated, the <cactifywar> task generated an
OutOfMemory error.  The stack trace follows:

<snip>
unit-tests:
[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
</snip>

I can still run any of my non-Cactus/non-testing target, including
compile, which does not set a max/min memory for the JVM that <javac>
uses.  But if I attempt to run any of the Cactus-related tasks, I get an
OutOfMemory error.  I'm assuming that I'll have to possibly fork the the
testing processes, but I'm still not sure why the error starting popping
up after two days of successful test runs.

TIA
b



RE: OutOfMemory Error and CactifyWar...

Posted by brian janaszek <bj...@collaborativefusion.com>.
On Tue, 2003-10-07 at 10:46, Vincent Massol wrote:
> Hi Brian,
> 
> Do you think you could create a bugzilla issue for this so that we don't
> forget about it? :-)
> 

Can do.

b

RE: OutOfMemory Error and CactifyWar...

Posted by brian janaszek <bj...@collaborativefusion.com>.
Occasional success....

I set the ANT_OPTS env variable to -Xmx256m, and that allows me to run
my tests _some_ of the time, depending on what else is running on my
machine....

b

RE: OutOfMemory Error and CactifyWar...

Posted by brian janaszek <bj...@collaborativefusion.com>.
Just a few more bits about my OutOfMemory issue....

According to gkrellm, I've got 348M of memory free before I start Ant. 
Once Ant starts, and the <cactifywar> task is called, this drops to
about 287M free.  Should I attempt to start Ant with a smaller max
memory allocation and see if that helps?  Would that even make a
difference?

b


RE: OutOfMemory Error and CactifyWar...

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Brian,

Do you think you could create a bugzilla issue for this so that we don't
forget about it? :-)

Thanks
-Vincent

> -----Original Message-----
> From: brian janaszek [mailto:bjanaszek@collaborativefusion.com]
> Sent: 07 October 2003 16:36
> To: Cactus Users List
> Subject: Re: OutOfMemory Error and CactifyWar...
> 
> On Tue, 2003-10-07 at 10:28, Christopher Lenz wrote:
> > there is a rather serious problem with the implementation of the
> CactifyWar
> > task: it will read the content of the entire WAR into memory to be
able
> to
> > analyze whether it needs to add the cactus JARs. Thus if your WAR is
> very
> > large, it could be possible for the task to run out of memory. I
wanted
> to
> > have this issue addressed quite some time ago, but haven't had the
time
> (and
> > maybe not the skill ;-P ) so far.
> >
> > 'tis pretty weird that the exception is thrown from
> Project.executeTarget
> > though. Maybe the nested exception gives the exact location where
we're
> > running out of memory? (I suspect it to be the WarArchive class).
> 
> Hum.  That must be the issue, as the WAR is roughly 44M (yeah, it's a
> big app).  As far as the nested exception goes....what you see is what
I
> get.  And that's running ant -v.
> 
> So, is there a workaround for this (besides shutting down other apps
to
> free up memory space)?
> 
> Thanks
> b


Re: OutOfMemory Error and CactifyWar...

Posted by brian janaszek <bj...@collaborativefusion.com>.
On Tue, 2003-10-07 at 10:28, Christopher Lenz wrote:
> there is a rather serious problem with the implementation of the CactifyWar 
> task: it will read the content of the entire WAR into memory to be able to 
> analyze whether it needs to add the cactus JARs. Thus if your WAR is very 
> large, it could be possible for the task to run out of memory. I wanted to 
> have this issue addressed quite some time ago, but haven't had the time (and 
> maybe not the skill ;-P ) so far.
> 
> 'tis pretty weird that the exception is thrown from Project.executeTarget 
> though. Maybe the nested exception gives the exact location where we're 
> running out of memory? (I suspect it to be the WarArchive class).

Hum.  That must be the issue, as the WAR is roughly 44M (yeah, it's a
big app).  As far as the nested exception goes....what you see is what I
get.  And that's running ant -v.

So, is there a workaround for this (besides shutting down other apps to
free up memory space)?

Thanks
b

Re: OutOfMemory Error and CactifyWar...

Posted by Christopher Lenz <cm...@gmx.de>.
Hi Brian,

there is a rather serious problem with the implementation of the CactifyWar 
task: it will read the content of the entire WAR into memory to be able to 
analyze whether it needs to add the cactus JARs. Thus if your WAR is very 
large, it could be possible for the task to run out of memory. I wanted to 
have this issue addressed quite some time ago, but haven't had the time (and 
maybe not the skill ;-P ) so far.

'tis pretty weird that the exception is thrown from Project.executeTarget 
though. Maybe the nested exception gives the exact location where we're 
running out of memory? (I suspect it to be the WarArchive class).

-chris

brian janaszek wrote:
> Hi--
> 
> I've been developing a testing framework for our web application (the
> app uses Turbine 2.2/Torque 3.1 as a its framework), and I've finally
> settled on Cactus for a testing framework.  Here's a brief overview of
> the system...
> 
> Linux (RedHat 8)
> Turbine 2.2 (Tomcat 4.x)
> Ant 1.6 (built from source)
> 
> Until this morning, I was able to successfully run basic Cactus tests on
> my machine.  Then, after modifying a test class, I ran my compile target
> (which also generates a WAR file) and my unit-tests target (which uses
> the Ant <cactus> and <cactifywar> tasks), and once the classes were
> compiled and the WAR generated, the <cactifywar> task generated an
> OutOfMemory error.  The stack trace follows:
> 
> <snip>
> unit-tests:
> [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
> </snip>
> 
> I can still run any of my non-Cactus/non-testing target, including
> compile, which does not set a max/min memory for the JVM that <javac>
> uses.  But if I attempt to run any of the Cactus-related tasks, I get an
> OutOfMemory error.  I'm assuming that I'll have to possibly fork the the
> testing processes, but I'm still not sure why the error starting popping
> up after two days of successful test runs.
> 
> TIA
> b
> 
>