Hi Caleb,
On Oct 22, 2009, at 6:27 AM, Caleb James DeLisle wrote:
I was able to plug most of the memory leakage by
adding
this.context.clear();
to AbstractBridgedXWikiComponentTestCase#tearDown()
core/xwiki-core/ will test with argLine>-Xmx64m added and
forkMode>pertest removed.
Hey, thanks for keeping working on this! :)
On the one hand it would be nicer to route out the
leakage but it
also is nice to allow
developers to use the context promiscuously in tests without worry
about introducing stubborn leaks.
Yes I hesitated between both choices for this exact reason. I favored
the security over the speed. Maybe I was wrong, I don't know.
We need more feedback from others to see if we leave it as it is or do
what you suggest (btw I also started to remove the leakage by
introducing context = null in the teardown and other init to null +
explicit calls to System.gc()) and it did lower the memory need and
allowed the tests to pass. However I was far from having completely
removed the leak and I thought this looked a bit hackish in the code +
it wouldn't guarantee that it would always work.
I see a doubling in the speed of testing
core/xwiki-core/ with mvn
clean test.
I'm not around much lately as there is a lot to be done to prepare
for winter.
Take care.
Thanks
-Vincent
Caleb James DeLisle
Vincent Massol wrote:
> On Oct 19, 2009, at 11:50 AM, Sergiu Dumitriu wrote:
>
>> On 10/19/2009 11:27 AM, vmassol (SVN) wrote:
>>> Author: vmassol
>>> Date: 2009-10-19 11:27:22 +0200 (Mon, 19 Oct 2009)
>>> New Revision: 24562
>>>
>>> Modified:
>>> platform/core/branches/xwiki-core-2.0/xwiki-core/pom.xml
>>> Log:
>>> XWIKI-4496: Unit tests need more heap space
>>>
>>> * Isolate tests.
>>>
>>> Merged from trunk (rev 24561)
>>>
>>> Modified: platform/core/branches/xwiki-core-2.0/xwiki-core/pom.xml
>>> ===================================================================
>>> --- platform/core/branches/xwiki-core-2.0/xwiki-core/pom.xml
>>> 2009-10-19 09:23:06 UTC (rev 24561)
>>> +++ platform/core/branches/xwiki-core-2.0/xwiki-core/pom.xml
>>> 2009-10-19 09:27:22 UTC (rev 24562)
>>> @@ -819,6 +819,14 @@
>>> </dependencies>
>>> <build>
>>> <plugins>
>>> +<plugin>
>>> +<groupId>org.apache.maven.plugins</groupId>
>>> +<artifactId>maven-surefire-plugin</artifactId>
>>> +<configuration>
>>> +<!-- Prevent Out Of Memory errors resulting from tests that do no
>>> free up the memory correctly -->
>>> +<forkMode>pertest</forkMode>
>> Does this affect performace? As in longer time to run the tests?
>
> It should normally affect speed (ie be slower). I haven't done a full
> comparison but I haven't found that it took way more time than
> before.
> I'm waiting for hudson to run to see the speed difference.
>
> -Vincent