You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Amita Vadhavkar <am...@gmail.com> on 2007/05/01 13:56:26 UTC

[Maven] Heap memory error - Help wanted! Maven experts!

Hi ,
When I add any new test cases to DAS Unit Tests, I get the below error

testMultiSchemaCase14(org.apache.tuscany.das.rdb.test.MultiSchemaTests)
 Time el
apsed: 1.382 sec  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

My MVN_OPTS are as below:-
set MAVEN_OPTS=-Xms256m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m
Tried manipulating these with some +- but same error.

Also, when I removed these my newly added test cases (thinking the new code
may have
some memory issues) and just added some pre-existing test cases a couple of
more times
like say, just added 4 times  ProgrammaticConfigTests, to
AllCommonTests.java, I get the same error.

suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
suite.addTest(new TestSuite(ProgrammaticConfigTests.class));

So, it looks like either
1) maven has some max limit of test cases beyond which it gives memory error

Or
2) All of DAS pre-existing unit test cases have some memory leak
which crashes maven
beyond some certain number of test cases.

Any clue, please let me know, will be really helpful.

Regards,
Amita

Re: [Maven] Heap memory error - Help wanted! Maven experts!

Posted by Amita Vadhavkar <am...@gmail.com>.
Hi Luciano,
I also used code from trunk.
I did the same exercise and found that when ProgrammaticConfigTests is there
6 times I get
heap error (on code from trunk). I am trying jprofiler on this and see the
the number of DASImpl and other major classes instances just keep building
up in heap mempry through
the execution of AllDerbyTests.

Also, if we execute this (AllDerbyTests) in eclipse, it is quite visible at
the last few runs of ProgrammaticConfigTests  that the machine gets very
slow and other processes just hang.
My machine has 1.5 GB RAM. Whenther the process crashes or not will finally
depend on
our machine RAM too, as by default JVM will try to grab more free memory as
much
as is available on the machine.

I am attaching the jprofiler results with the above case (i.e. no code from
JIRA-952) and
total 6 ProgrammaticConfigTests . See how the memory usage is building over
time.

A few points I noted here, not sure how significant these will be, please
let me know
your opinion.
1) We don't have any finalize() method in DAS
2) The way DasTest and DatabaseSetup - share the JDBC connection and make it
static,
the references to the same connection keep increasing. Also, as in most of
the JUnit tests
we pass this connection to DASImpl, the DASImpl instances may not be getting
GCed
(as the ref to a valid object - connection is there in all these instances
of DASImpl).
3) This can be the reason, why Derby class instances also occupy lot of
memory over time.

I am still investigating and not reached any conclusion. Please let me know
if you have
any hints about troubleshooting this.

Regards,
Amita

On 5/2/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Hi Amita
>
>   Without any changes from your patches, I tried to add several tests
> cases
> by copying the tests from ProgramaticConfig multiple times, and all tests
> were still working fine. I only start seeing the OutOfMemory issues after
> applying your changes, but I cant tell for sure what is the cause of the
> OutOfMemory errors.
>
> On 5/1/07, Amita Vadhavkar <am...@gmail.com> wrote:
> >
> > Hi ,
> > When I add any new test cases to DAS Unit Tests, I get the below error
> >
> > testMultiSchemaCase14(org.apache.tuscany.das.rdb.test.MultiSchemaTests)
> > Time el
> > apsed: 1.382 sec  <<< ERROR!
> > java.lang.OutOfMemoryError: Java heap space
> > java.lang.OutOfMemoryError: Java heap space
> >
> > My MVN_OPTS are as below:-
> > set MAVEN_OPTS=-Xms256m -Xmx1024m -XX:PermSize=1024m
> -XX:MaxPermSize=1024m
> > Tried manipulating these with some +- but same error.
> >
> > Also, when I removed these my newly added test cases (thinking the new
> > code
> > may have
> > some memory issues) and just added some pre-existing test cases a couple
> > of
> > more times
> > like say, just added 4 times  ProgrammaticConfigTests, to
> > AllCommonTests.java, I get the same error.
> >
> > suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> > suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> > suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> > suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> >
> > So, it looks like either
> > 1) maven has some max limit of test cases beyond which it gives memory
> > error
> >
> > Or
> > 2) All of DAS pre-existing unit test cases have some memory leak
> > which crashes maven
> > beyond some certain number of test cases.
> >
> > Any clue, please let me know, will be really helpful.
> >
> > Regards,
> > Amita
> >
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
>

Re: [Maven] Heap memory error - Help wanted! Maven experts!

Posted by Luciano Resende <lu...@gmail.com>.
Hi Amita

   Without any changes from your patches, I tried to add several tests cases
by copying the tests from ProgramaticConfig multiple times, and all tests
were still working fine. I only start seeing the OutOfMemory issues after
applying your changes, but I cant tell for sure what is the cause of the
OutOfMemory errors.

On 5/1/07, Amita Vadhavkar <am...@gmail.com> wrote:
>
> Hi ,
> When I add any new test cases to DAS Unit Tests, I get the below error
>
> testMultiSchemaCase14(org.apache.tuscany.das.rdb.test.MultiSchemaTests)
> Time el
> apsed: 1.382 sec  <<< ERROR!
> java.lang.OutOfMemoryError: Java heap space
> java.lang.OutOfMemoryError: Java heap space
>
> My MVN_OPTS are as below:-
> set MAVEN_OPTS=-Xms256m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m
> Tried manipulating these with some +- but same error.
>
> Also, when I removed these my newly added test cases (thinking the new
> code
> may have
> some memory issues) and just added some pre-existing test cases a couple
> of
> more times
> like say, just added 4 times  ProgrammaticConfigTests, to
> AllCommonTests.java, I get the same error.
>
> suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
> suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
>
> So, it looks like either
> 1) maven has some max limit of test cases beyond which it gives memory
> error
>
> Or
> 2) All of DAS pre-existing unit test cases have some memory leak
> which crashes maven
> beyond some certain number of test cases.
>
> Any clue, please let me know, will be really helpful.
>
> Regards,
> Amita
>



-- 
Luciano Resende
http://people.apache.org/~lresende