You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ronan Klyne <ro...@groupbc.com> on 2007/09/12 16:43:18 UTC

Memory usage

Hi all,

I have a fairly small (but complex) test plan which keeps causing
OutOfMemory errors when I run it with more than 5 threads...
Has anyone else seen a similar problem? Are there any known simple fixes?
(I've already removed all listeners expect Simple Data Writers)

Cheers,

	Ronan

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by sebb <se...@gmail.com>.
On 13/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> sebb wrote:
> > Does the test fall over immediately, or only after several iterations?
> >
> > The CSVRead() function reads the whole file into memory, so if you are
> > using it for a large file, replace it with CSV Dataset.
> Already using dataset (purely by chance).
>
> > BeanShell leaks memory particularly if scripts are read from the
> > screen; use files to store code as much as possible.
> /me nods.
>
> > If you are using Assertions, try disabling them all. I don't think
> > these use lots of memory - except perhaps XPath - but worth a try.
> Tried that - there were many fewer than I thought I'd put in, none of
> them XPath.
> I do, however, have a large number of XPath Extractors. Do you think
> these could be causing the problem? Would it be better if they were
> replaced with regex extractors?

Could be. Might be worth trying a simple test with one of the XPath
Extractors, and repeat different numbers of times; comparison will
show if there is a leak.

>        # r
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by sebb <se...@gmail.com>.
On 13/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> Bj wrote:
> > What are your HEAP Xms and Xmx jvm options ?
> > By default it's 256Mo and it's enough most of time.
> > But you can increase these values depending of your OS (32bit or 64bit) and
> > your available memory.
> >
> > --
> > Bj
> >
>
> I've got it set to 1.25Gb, with more ram on order.
> This seems like a lot of memory for a 5 thread test...

Especially since there's another conversation where there are up to
1500 threads !

>        # r
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by sebb <se...@gmail.com>.
On 14/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> sebb wrote:
> > On 13/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> >> Bj wrote:
> >>> Very hungry threads !
> >>> There's obvously a memory leak somewhere.
> >>> How long it's running with 5 threads ?
> >>>
> >> About 10 minutes.
> >
> > Is that several loops?
> >
> > If so, that suggests a leak.
> >
> > Perhaps try adding some timers to the test plan to make it easier to
> > see when the memory increases.
> >
> > If it still runs about as many samples before running out of memory,
> > that would tend to confirm a memory leak from one of the test
> > elements.
>
> Yes, it's several loops. Using 4 threads only, I start using 830Mb of
> ram, which then climbs by 20Mb every 2-3 minutes.
> Any advice on how to find this leak? I don't see what information the
> timers will provide for me - what should I do with them?

The timers are useful to slow down the test, so you can see which
parts of the test cause the memory usage to increase.

Otherwise, try disabling parts of the test to see which has most effect.

> Also, advice on how to reduce the initial memory requirement woud be
> useful...

http://jakarta.apache.org/jmeter/usermanual/best-practices.html

>        # r
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by Ronan Klyne <ro...@groupbc.com>.
sebb wrote:
> On 13/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
>> Bj wrote:
>>> Very hungry threads !
>>> There's obvously a memory leak somewhere.
>>> How long it's running with 5 threads ?
>>>
>> About 10 minutes.
> 
> Is that several loops?
> 
> If so, that suggests a leak.
> 
> Perhaps try adding some timers to the test plan to make it easier to
> see when the memory increases.
> 
> If it still runs about as many samples before running out of memory,
> that would tend to confirm a memory leak from one of the test
> elements.

Yes, it's several loops. Using 4 threads only, I start using 830Mb of
ram, which then climbs by 20Mb every 2-3 minutes.
Any advice on how to find this leak? I don't see what information the
timers will provide for me - what should I do with them?
Also, advice on how to reduce the initial memory requirement woud be
useful...

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by sebb <se...@gmail.com>.
On 13/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> Bj wrote:
> > Very hungry threads !
> > There's obvously a memory leak somewhere.
> > How long it's running with 5 threads ?
> >
>
> About 10 minutes.

Is that several loops?

If so, that suggests a leak.

Perhaps try adding some timers to the test plan to make it easier to
see when the memory increases.

If it still runs about as many samples before running out of memory,
that would tend to confirm a memory leak from one of the test
elements.

>        # r
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by Ronan Klyne <ro...@groupbc.com>.
Bj wrote:
> Very hungry threads !
> There's obvously a memory leak somewhere.
> How long it's running with 5 threads ?
> 

About 10 minutes.

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by Bj <bj...@gmail.com>.
Very hungry threads !
There's obvously a memory leak somewhere.
How long it's running with 5 threads ?

-- 
BJ

On 9/13/07, Ronan Klyne <ro...@groupbc.com> wrote:
>
> Bj wrote:
> > What are your HEAP Xms and Xmx jvm options ?
> > By default it's 256Mo and it's enough most of time.
> > But you can increase these values depending of your OS (32bit or 64bit)
> and
> > your available memory.
> >
> > --
> > Bj
> >
>
> I've got it set to 1.25Gb, with more ram on order.
> This seems like a lot of memory for a 5 thread test...
>
>         # r
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Memory usage

Posted by Ronan Klyne <ro...@groupbc.com>.
Bj wrote:
> What are your HEAP Xms and Xmx jvm options ?
> By default it's 256Mo and it's enough most of time.
> But you can increase these values depending of your OS (32bit or 64bit) and
> your available memory.
> 
> --
> Bj
> 

I've got it set to 1.25Gb, with more ram on order.
This seems like a lot of memory for a 5 thread test...

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by Bj <bj...@gmail.com>.
What are your HEAP Xms and Xmx jvm options ?
By default it's 256Mo and it's enough most of time.
But you can increase these values depending of your OS (32bit or 64bit) and
your available memory.

--
Bj

Re: Memory usage

Posted by Ronan Klyne <ro...@groupbc.com>.
sebb wrote:
> Does the test fall over immediately, or only after several iterations?
> 
> The CSVRead() function reads the whole file into memory, so if you are
> using it for a large file, replace it with CSV Dataset.
Already using dataset (purely by chance).

> BeanShell leaks memory particularly if scripts are read from the
> screen; use files to store code as much as possible.
/me nods.

> If you are using Assertions, try disabling them all. I don't think
> these use lots of memory - except perhaps XPath - but worth a try.
Tried that - there were many fewer than I thought I'd put in, none of
them XPath.
I do, however, have a large number of XPath Extractors. Do you think
these could be causing the problem? Would it be better if they were
replaced with regex extractors?

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Memory usage

Posted by sebb <se...@gmail.com>.
Does the test fall over immediately, or only after several iterations?

The CSVRead() function reads the whole file into memory, so if you are
using it for a large file, replace it with CSV Dataset.

BeanShell leaks memory particularly if scripts are read from the
screen; use files to store code as much as possible.

If you are using Assertions, try disabling them all. I don't think
these use lots of memory - except perhaps XPath - but worth a try.

S///
On 12/09/2007, Ronan Klyne <ro...@groupbc.com> wrote:
> Hi all,
>
> I have a fairly small (but complex) test plan which keeps causing
> OutOfMemory errors when I run it with more than 5 threads...
> Has anyone else seen a similar problem? Are there any known simple fixes?
> (I've already removed all listeners expect Simple Data Writers)
>
> Cheers,
>
>        Ronan
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 (0)870 163 2555
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org