jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: Java Sampler causing Memory Leak
Date Sun, 21 Jun 2009 21:25:37 GMT
if it gives you just your xmlstream you should be fine , the vars is similar
to the java.util.Map , so you can just print out size (number of elements ,
not the memory footprint) , vars.entrySet().size(). Alternately, at the end
of every iteration you could reset all the variables using a beanshell post
- processor, but it doesnt sound as if your vars is a problem.

>but when I look into the
>heap dump it seems to be in the httpSampler part where there is the memory
>leak. However, I do not know how to be really sure.

if you take multiple heap dumps  and compare the differences and see whats
growing . I cant remember whether you can do this with JHAT(i think you can,
plus there is a flag which says XX:HeapDumpOnCtrlBreak or something like
that), but you could with jprobe/optimize it (you get evaluation editions
for 15 days), you probably would need to add a delay between each iteration
so that you can run an iteration, force a GC, and then run another
iteration, force a GC and see what has remained behind, thats your leak. id
probably also create a reduced version of your test so that it minimises the
number of things that could be causing your problem.

regards
deepak

On Sun, Jun 21, 2009 at 2:04 PM, tomada <thomas.rasoa@gmail.com> wrote:

>
> Hi !
>
> Ok so I use print(vars.entrySet()); and it gives me my xmlstream for each
> iteration. What is the script to get the size or something else ?
> At the beginning, I thought it was my Sampler code but when I look into the
> heap dump it seems to be in the httpSampler part where there is the memory
> leak. However, I do not know how to be really sure.
>
> Regards
>
> Tomada
>
>
> Deepak Shetty wrote:
> >
> > Hi
> > i mean use the beanshell pre processor for diagnostics.
> > Right click the sample and add a beanshell pre processor and in the
> script
> > type
> > print(vars.entrySet());
> > or the size or something and see if this keeps growing with every
> > iteration
> > (I dont think the HttpSample holds on to the parameters so this shouldnt
> > be
> > the cause of your outofmemory).
> > the other source of the leak might be your sampler code.
> > regards
> > deepak
> >
> >
> >
> > On Sun, Jun 21, 2009 at 1:31 PM, tomada <thomas.rasoa@gmail.com> wrote:
> >
> >>
> >> Hi !
> >>
> >> I do not use different variable names each time. No I did not use the
> >> beanshell pre processors. How do you use it ?
> >> When I did the load test I removed the listeners and execute Jmeter
> >> without
> >> GUI.
> >> Regards
> >> Tomada
> >>
> >>
> >> Deepak Shetty wrote:
> >> >
> >> > hi
> >> > just a couple of queries
> >> > a. are you using different variable names each time?  can you print
> out
> >> > vars
> >> > say using beanshell preprocessors and see if this keeps growing?
> >> > b. are you using some listeners like view results tree? if so can you
> >> run
> >> > your test with these listeners disabled?
> >> > regards
> >> > deepak
> >> >
> >> > On Fri, Jun 19, 2009 at 3:33 PM, tomada <thomas.rasoa@gmail.com>
> wrote:
> >> >
> >> >>
> >> >> Hi all !
> >> >>
> >> >> I am little new in Jmeter community and I am currently using it for
> >> Load
> >> >> test on a server with a lot of datas (400kb/thread)
> >> >> In order to generate those datas I need (in form of xmlstream) I use
> >> the
> >> >> java sampler to do it.
> >> >> You can see below the part of my scenario about it :
> >> >> Loop Controller : Forever (I just have to stop the test when I want
> >> to)
> >> >>     |-----------Java Sampler : generating a xmlstream and put it in
> >> the
> >> >> response message
> >> >>     |-----------RegExpExtractor : get the xmlstream in response
> >> message
> >> >> and
> >> >> put it in a variable ${myXmlStream}
> >> >>     |-----------HttpRequest : sendValues?${myXmlStream}
> >> >>
> >> >> Unfortunately, as I am doing a forever loop on it (my Java Sampler
> and
> >> my
> >> >> sendvalues http request)to keep control on the load test time, I
> >> quickly
> >> >> get
> >> >> memory issues (out of Memory errors)which make Jmeter crashes. I
> >> already
> >> >> have increase the heap size but it just postpones it. I look into the
> >> >> heap
> >> >> dump and apparently it is the queryString object in the httpSampler
> >> which
> >> >> contains my xmlStream which is keeping (maybe too long) the
> xmlStream.
> >> >> One solution I find (and please tell me if it is right one or if may
> >> >> choose
> >> >> another one) is to directly generate the XmlStream in a a kind of new
> >> >> HTTPSampler object. So I create a NewHTTPSampler object extending
> >> >> HTTPSampler, first override the sample () method to not send the
> >> >> queryString
> >> >> content, then build my component which actually becomes a plugin, and
> >> >> then
> >> >> put the jar in the lib/ext folder but when I am executing Jmeter I
> see
> >> >> nothing new in the sampler menu.
> >> >> What can I do to succeed in doing what i want to do ? Is what I did
> >> the
> >> >> right way to deal with the memory leak or can I handle it in easier
> >> way
> >> ?
> >> >>
> >> >> Thank you for your help.
> >> >>
> >> >> Tomada
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Java-Sampler-causing-Memory-Leak-tp24119770p24119770.html
> >> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Java-Sampler-causing-Memory-Leak-tp24119770p24138544.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Java-Sampler-causing-Memory-Leak-tp24119770p24138814.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message