[Webtest] Re: java.lang.OutOfMemoryError when performing login test

Lothar Märkle webtest@lists.canoo.com
Tue, 24 Jan 2006 10:36:40 +0100


Hi Archit,

On Fri, Jan 20, 2006 at 12:10:58PM +0530, Archit P wrote:
> After some 50 call of the target "main" it threw
> java.lang.OutOfMemoryError. I profiled the execution and found that the
> Config elements were not destroyed after the target "main" was complete.
> For every execution there was one Config element that persisted across
> ant target calls.

Could you please explain how you tracked this down? Perhaps what tool
you used? I tried some tests with a profiler(jprofiler), but I could not exactly
find out what hold the memory. But what I definitly got was, that some
memory was not freed like in

<target name="start">
  heap snapshot a
  <antcall target="test"/>
  heap snapshot b
  <antcall target="test"/>
  heap snapshot c
  <antcall target="test"/>
  heap snapshot d
  ...
</target>

<target name="test">
  <webtest>
  ...
  </webtest>
</targe>


there was a constant grow of memory
consumption. For every antcall there was a antclassloader left, witch
holds refs to a lot of webtest and htmlunit classes and objects.

The static log fields in every unit test could also be a problem.
They hold refs to the webtest step class objects, what could be the reason for the
leftover classloaders?

A little bit foggy, but any ideas?
  lothar



> -----Original Message-----
> From: Marc Guillemot [mailto:mguillemot@yahoo.fr] 
> Sent: Friday, January 20, 2006 3:00 AM
> To: webtest@lists.canoo.com
> Subject: [Webtest] Re: java.lang.OutOfMemoryError when performing login
> test
> 
> 
> >>>Have you tried to profile it to see what takes too much memory? I 
> >>>guess that the problem (but is it really a problem or just work as 
> >>>designed) is that all information are kept in memory until the test 
> >>>(ie the
> >>></webtest>) finishes.
> > 
> > Is it really that much information?
> 
> I don't know, I just try to imagine what is stored and kept in memory
> (except if we have some memory leaks). Rougthly speaking, this is what
> is then written in the xml file: the attributes of each step as well as
> the eventual parser errors/warnings. Personally I've only encountered
> problem with the xml result file that gets too big.
> 
> Marc.
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
> 
> MASTEK 
> "Making a valuable difference"
> Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
> In the US, we're called MAJESCOMASTEK
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from all computers.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest

-- 
Lothar Märkle - lothar.maerkle@netpioneer.de
Netpioneer GmbH - Beiertheimer Allee 18a - D-76137 Karlsruhe
Tel: 0721 / 9 20 60 43
Fax: 0721 / 9 20 60 30