velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Roche <>
Subject out of memory /heap overflow after many VelocityEngin.init calls
Date Wed, 31 Oct 2007 15:36:46 GMT

while unit testing my project, I encountered an out of memory 
problem. More than 100 test methods resulted in an init call on a 
After more or less 35 correct executions, all the next tests launch 
an OutOfMemoryError - heap overflow
I googled for it, and it seems to be a know problem.

Actually for me the thing is not to find a way to run my tests. The 
problem is that the application I'm working on is a generic 
application, made to run many clients. I'm using velocity to make 
html mail templates, and each client has to have his own templates, 
which all are in separate directories. That's why I didn't choose the 
singleton Velocity pattern.

So even if the error I deal with right now is about the number of 
tests I'm running, it's nonetheless symptomatic of a limitation I 
will encounter later.

Is there a known good pattern which would meet my constraints ?

One thing I don't understand is why do I have a OutOfMemoryError. 
Each VelocityEngine is created by a test case. Shouldn't they be 
cleanly destroyed at the end of the test case ? And then why would 
that make an overflow if it was correct ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message