You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ja...@umich.edu on 2005/08/03 21:06:47 UTC

Memory leaks - large and uncollected

Hi,

I've created a script which generates thousands of HTTP requests; the 
script seems to work fine, but I'm seeing a large memory leak in JMeter 
itself.  Before you write this off as a "newbie" question, here is 
everything I've tried to do to fix it:

1.  Deleting _all_ listeners.  I still see the memory leak, even when 
running without any listeners.
2.  Stopping the test and doing "Clear all".  The memory is _not_ 
reclaimed, even after a full garbage collection.
3.  Increasing the memory available to JMeter to 1GB.  As the test runs, 
the memory usage climbs until its doing continuous full garbage 
collections.  Eventually an OutOfMemory exception occurs.
4.  Switching the HTML parser from the default to the RegexpHTMLParser. 
Still see the same memory leak, albeit slower.

Does this sound familiar to anyone?  It appears to be a slow leak 
per-request.  I'm running XP against an SSL-enabled server.  Does SSL leak 
memory per-connection?  "netstat -n" shows thousands of connections - and 
it looks like they don't go away until JMeter quits.

I only see the leak if I do on the order of 100,000+ HTTP requests.  I can 
send interested parties the script to test for themselves.  I'm not 
attaching the script now since its 500KB.

I really need to figure out what is going wrong.  I'm about to attempt to 
run a memory profiler (OptimizeIt) on JMeter to determine where the leak is 
under-the-covers...

Thanks,

-Jon Andersen
The Sakai Project
http://www.sakaiproject.org

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


Re: Memory leaks - large and uncollected

Posted by Michael Stover <ms...@apache.org>.
Sadly, I don't think so, but what a great idea for a tool someone should
write.  You should make a bugzilla enhancement request for that.

-Mike

On Wed, 2005-08-03 at 16:02 -0400, Jon Andersen wrote:
> Peter,
> 
> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I ran 
> the same script without SSL, and don't see the memory usage growing.
> 
> Is there some way to switch from the default "HTTP Request" 
> implementation to the "HTTP Request HttpClient" implementation without 
> rewriting the script?  Do both use the same configuration, so I could 
> do a search-n-replace?
> 
> Thanks a bunch!
> 
> -Jon Andersen
> Software developer
> 734-260-6083 (work)
> 734-646-5577 (home)
> Digital Media Commons - Duderstadt Center
> University of Michigan
> 
> On Aug 3, 2005, at 3:14 PM, Peter Lin wrote:
> 
> > I've run optimizeIt on Jmeter about 3 dozen times when I wrote the
> > various samplers like Webservice, jms, accesslog and tomcat monitor.
> > Under normal conditions, JMeter's memory usage is constant. I've run
> > tests using OptimizeIt on JMeter for 500K, 1million and 2 million
> > requests.
> >
> > what I haven't done is try it on SSL. I believe there's a known bug
> > with Sun's SSL implementation which results in connections not closing
> > and resulting in OutOfMemoryException.  The solution to that is to use
> > HttpClient sampler instead of the default one.
> >
> > the default http sampler uses the Sun implementation, which I believe
> > exhibits that behavior. the HttpClient version should perform better.
> > You can also verify this by using HTTP with the same test instead of
> > HTTPS. If the bug doesn't appear in non-secure HTTP, it would support
> > the idea that HTTPS is the cause.
> >
> > I know that some EJB containers use Sun implementation for SSL/HTTPS
> > and they exhibit the same exact bug. If those connections are
> > time_wait and aren't getting cleaned up, it's very likely the known
> > SSL bug.
> >
> > peter
> >
> >
> >
> > On 8/3/05, janderse@umich.edu <ja...@umich.edu> wrote:
> >> Hi,
> >>
> >> I've created a script which generates thousands of HTTP requests; the
> >> script seems to work fine, but I'm seeing a large memory leak in 
> >> JMeter
> >> itself.  Before you write this off as a "newbie" question, here is
> >> everything I've tried to do to fix it:
> >>
> >> 1.  Deleting _all_ listeners.  I still see the memory leak, even when
> >> running without any listeners.
> >> 2.  Stopping the test and doing "Clear all".  The memory is _not_
> >> reclaimed, even after a full garbage collection.
> >> 3.  Increasing the memory available to JMeter to 1GB.  As the test 
> >> runs,
> >> the memory usage climbs until its doing continuous full garbage
> >> collections.  Eventually an OutOfMemory exception occurs.
> >> 4.  Switching the HTML parser from the default to the 
> >> RegexpHTMLParser.
> >> Still see the same memory leak, albeit slower.
> >>
> >> Does this sound familiar to anyone?  It appears to be a slow leak
> >> per-request.  I'm running XP against an SSL-enabled server.  Does SSL 
> >> leak
> >> memory per-connection?  "netstat -n" shows thousands of connections - 
> >> and
> >> it looks like they don't go away until JMeter quits.
> >>
> >> I only see the leak if I do on the order of 100,000+ HTTP requests.  
> >> I can
> >> send interested parties the script to test for themselves.  I'm not
> >> attaching the script now since its 500KB.
> >>
> >> I really need to figure out what is going wrong.  I'm about to 
> >> attempt to
> >> run a memory profiler (OptimizeIt) on JMeter to determine where the 
> >> leak is
> >> under-the-covers...
> >>
> >> Thanks,
> >>
> >> -Jon Andersen
> >> The Sakai Project
> >> http://www.sakaiproject.org
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> 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 leaks - large and uncollected

Posted by Peter Lin <wo...@gmail.com>.
please file a bugzilla for it. it sounds like a bug.


thanks

peter


On 8/9/05, Jon Andersen <ja...@umich.edu> wrote:
> Peter,
> 
> I see the error message repeated several times:
> INFO: Redirect requested but followRedirects is disabled
> 
> I think the results tree shows that the redirects are being followed.
> It looks to me like the cookie handling is incorrect somehow, since its
> appending an identically-named cookie rather than overwriting it.
> 
> Attachments:
> http://www.umich.edu/~janderse/sakai/resultstree.jtl
> http://www.umich.edu/~janderse/sakai/test.jmx
> 
> -Jon Andersen
> Software developer
> 734-260-6083 (work)
> 734-646-5577 (home)
> Digital Media Commons - Duderstadt Center
> University of Michigan
> 
> On Aug 9, 2005, at 11:58 AM, Peter Lin wrote:
> 
> > that might be a bug. do you see any errors in jmeter.log?
> >
> >
> > peter
> >
> >
> > On 8/9/05, Jon Andersen <ja...@umich.edu> wrote:
> >> I tried using HTTPSampler2 as suggested.  However, now there is
> >> another
> >> problem, which shows up even without SSL.  Once I switch to
> >> HTTPSampler2, cookies or redirects aren't handled properly anymore.
> >> The exact same script works fine with HTTPSampler, but with
> >> HTTPSampler2, the cookies fail.
> >>
> >> I'm seeing the same JSESSIONID cookie being set over and over again,
> >> with new values.  JMeter, instead of replacing the cookie each time,
> >> is
> >> appending a new cookie with the same name and the new value.  So the
> >> same-named cookies accumulate over each request.
> >>
> >> Does this HTTPSampler2 cookie bug sound familiar to anyone?
> >>
> >> Here is my script that generates the errors, and the results, if
> >> someone can take a look at it:
> >>
> >> http://www.umich.edu/~janderse/sakai/resultstree.jtl
> >> http://www.umich.edu/~janderse/sakai/test.jmx
> >>
> >> Thanks,
> >>
> >> -Jon Andersen
> >> Software developer
> >> 734-260-6083 (work)
> >> 734-646-5577 (home)
> >> Digital Media Commons - Duderstadt Center
> >> University of Michigan
> >>
> >> On Aug 3, 2005, at 7:02 PM, sebb wrote:
> >>
> >>> On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
> >>>> Peter,
> >>>>
> >>>> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I
> >>>> ran
> >>>> the same script without SSL, and don't see the memory usage growing.
> >>>>
> >>>> Is there some way to switch from the default "HTTP Request"
> >>>> implementation to the "HTTP Request HttpClient" implementation
> >>>> without
> >>>> rewriting the script?  Do both use the same configuration, so I
> >>>> could
> >>>> do a search-n-replace?
> >>>
> >>> Yes, if using 2.0.3, just perform the following changes:
> >>>
> >>> <testelement
> >>> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
> >>> becomes:
> >>> <testelement
> >>> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">
> >>>
> >>> <property xml:space="preserve"
> >>> propType="org.apache.jmeter.testelement.property.StringProperty"
> >>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler
> >>> .H
> >>> TTPSampler</property>
> >>> becomes
> >>> <property xml:space="preserve"
> >>> propType="org.apache.jmeter.testelement.property.StringProperty"
> >>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler
> >>> .H
> >>> TTPSampler2</property>
> >>>
> >>> <property xml:space="preserve"
> >>> propType="org.apache.jmeter.testelement.property.StringProperty"
> >>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.
> >>> gu
> >>> i.HttpTestSampleGui</property>
> >>> becomes
> >>> <property xml:space="preserve"
> >>> propType="org.apache.jmeter.testelement.property.StringProperty"
> >>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.
> >>> gu
> >>> i.HttpTestSampleGui2</property>
> >>>
> >>> If you are using 2.1, then the set of changes is similar:
> >>>
> >>>
> >>> <HTTPSampler>
> >>>  =>
> >>> <HTTPSampler2>
> >>>
> >>> </HTTPSampler>
> >>>  =>
> >>> </HTTPSampler2>
> >>>
> >>> <stringProp
> >>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler
> >>> .H
> >>> TTPSampler</stringProp>
> >>> =>
> >>> <stringProp
> >>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler
> >>> .H
> >>> TTPSampler2</stringProp>
> >>>
> >>> <stringProp
> >>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.
> >>> gu
> >>> i.HttpTestSampleGui</stringProp>
> >>> =>
> >>> <stringProp
> >>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.
> >>> gu
> >>> i.HttpTestSampleGui2</stringProp>
> >>>
> >>>
> >>> I derived these by creating two test plans, one with a single HTTP
> >>> Sampler, and another with HTTP Sampler HTTPClient (using the same
> >>> element name), and then doing a comparison.
> >>>
> >>> [...]
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

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


Re: Memory leaks - large and uncollected

Posted by Jon Andersen <ja...@umich.edu>.
Peter,

I see the error message repeated several times:
INFO: Redirect requested but followRedirects is disabled

I think the results tree shows that the redirects are being followed.   
It looks to me like the cookie handling is incorrect somehow, since its  
appending an identically-named cookie rather than overwriting it.

Attachments:
http://www.umich.edu/~janderse/sakai/resultstree.jtl
http://www.umich.edu/~janderse/sakai/test.jmx

-Jon Andersen
Software developer
734-260-6083 (work)
734-646-5577 (home)
Digital Media Commons - Duderstadt Center
University of Michigan

On Aug 9, 2005, at 11:58 AM, Peter Lin wrote:

> that might be a bug. do you see any errors in jmeter.log?
>
>
> peter
>
>
> On 8/9/05, Jon Andersen <ja...@umich.edu> wrote:
>> I tried using HTTPSampler2 as suggested.  However, now there is  
>> another
>> problem, which shows up even without SSL.  Once I switch to
>> HTTPSampler2, cookies or redirects aren't handled properly anymore.
>> The exact same script works fine with HTTPSampler, but with
>> HTTPSampler2, the cookies fail.
>>
>> I'm seeing the same JSESSIONID cookie being set over and over again,
>> with new values.  JMeter, instead of replacing the cookie each time,  
>> is
>> appending a new cookie with the same name and the new value.  So the
>> same-named cookies accumulate over each request.
>>
>> Does this HTTPSampler2 cookie bug sound familiar to anyone?
>>
>> Here is my script that generates the errors, and the results, if
>> someone can take a look at it:
>>
>> http://www.umich.edu/~janderse/sakai/resultstree.jtl
>> http://www.umich.edu/~janderse/sakai/test.jmx
>>
>> Thanks,
>>
>> -Jon Andersen
>> Software developer
>> 734-260-6083 (work)
>> 734-646-5577 (home)
>> Digital Media Commons - Duderstadt Center
>> University of Michigan
>>
>> On Aug 3, 2005, at 7:02 PM, sebb wrote:
>>
>>> On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
>>>> Peter,
>>>>
>>>> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I
>>>> ran
>>>> the same script without SSL, and don't see the memory usage growing.
>>>>
>>>> Is there some way to switch from the default "HTTP Request"
>>>> implementation to the "HTTP Request HttpClient" implementation  
>>>> without
>>>> rewriting the script?  Do both use the same configuration, so I  
>>>> could
>>>> do a search-n-replace?
>>>
>>> Yes, if using 2.0.3, just perform the following changes:
>>>
>>> <testelement
>>> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
>>> becomes:
>>> <testelement
>>> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">
>>>
>>> <property xml:space="preserve"
>>> propType="org.apache.jmeter.testelement.property.StringProperty"
>>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler 
>>> .H
>>> TTPSampler</property>
>>> becomes
>>> <property xml:space="preserve"
>>> propType="org.apache.jmeter.testelement.property.StringProperty"
>>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler 
>>> .H
>>> TTPSampler2</property>
>>>
>>> <property xml:space="preserve"
>>> propType="org.apache.jmeter.testelement.property.StringProperty"
>>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control. 
>>> gu
>>> i.HttpTestSampleGui</property>
>>> becomes
>>> <property xml:space="preserve"
>>> propType="org.apache.jmeter.testelement.property.StringProperty"
>>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control. 
>>> gu
>>> i.HttpTestSampleGui2</property>
>>>
>>> If you are using 2.1, then the set of changes is similar:
>>>
>>>
>>> <HTTPSampler>
>>>  =>
>>> <HTTPSampler2>
>>>
>>> </HTTPSampler>
>>>  =>
>>> </HTTPSampler2>
>>>
>>> <stringProp
>>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler 
>>> .H
>>> TTPSampler</stringProp>
>>> =>
>>> <stringProp
>>> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler 
>>> .H
>>> TTPSampler2</stringProp>
>>>
>>> <stringProp
>>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control. 
>>> gu
>>> i.HttpTestSampleGui</stringProp>
>>> =>
>>> <stringProp
>>> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control. 
>>> gu
>>> i.HttpTestSampleGui2</stringProp>
>>>
>>>
>>> I derived these by creating two test plans, one with a single HTTP
>>> Sampler, and another with HTTP Sampler HTTPClient (using the same
>>> element name), and then doing a comparison.
>>>
>>> [...]
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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 leaks - large and uncollected

Posted by Peter Lin <wo...@gmail.com>.
that might be a bug. do you see any errors in jmeter.log?


peter


On 8/9/05, Jon Andersen <ja...@umich.edu> wrote:
> I tried using HTTPSampler2 as suggested.  However, now there is another
> problem, which shows up even without SSL.  Once I switch to
> HTTPSampler2, cookies or redirects aren't handled properly anymore.
> The exact same script works fine with HTTPSampler, but with
> HTTPSampler2, the cookies fail.
> 
> I'm seeing the same JSESSIONID cookie being set over and over again,
> with new values.  JMeter, instead of replacing the cookie each time, is
> appending a new cookie with the same name and the new value.  So the
> same-named cookies accumulate over each request.
> 
> Does this HTTPSampler2 cookie bug sound familiar to anyone?
> 
> Here is my script that generates the errors, and the results, if
> someone can take a look at it:
> 
> http://www.umich.edu/~janderse/sakai/resultstree.jtl
> http://www.umich.edu/~janderse/sakai/test.jmx
> 
> Thanks,
> 
> -Jon Andersen
> Software developer
> 734-260-6083 (work)
> 734-646-5577 (home)
> Digital Media Commons - Duderstadt Center
> University of Michigan
> 
> On Aug 3, 2005, at 7:02 PM, sebb wrote:
> 
> > On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
> >> Peter,
> >>
> >> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I
> >> ran
> >> the same script without SSL, and don't see the memory usage growing.
> >>
> >> Is there some way to switch from the default "HTTP Request"
> >> implementation to the "HTTP Request HttpClient" implementation without
> >> rewriting the script?  Do both use the same configuration, so I could
> >> do a search-n-replace?
> >
> > Yes, if using 2.0.3, just perform the following changes:
> >
> > <testelement
> > class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
> > becomes:
> > <testelement
> > class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">
> >
> > <property xml:space="preserve"
> > propType="org.apache.jmeter.testelement.property.StringProperty"
> > name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H
> > TTPSampler</property>
> > becomes
> > <property xml:space="preserve"
> > propType="org.apache.jmeter.testelement.property.StringProperty"
> > name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H
> > TTPSampler2</property>
> >
> > <property xml:space="preserve"
> > propType="org.apache.jmeter.testelement.property.StringProperty"
> > name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu
> > i.HttpTestSampleGui</property>
> > becomes
> > <property xml:space="preserve"
> > propType="org.apache.jmeter.testelement.property.StringProperty"
> > name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu
> > i.HttpTestSampleGui2</property>
> >
> > If you are using 2.1, then the set of changes is similar:
> >
> >
> > <HTTPSampler>
> >  =>
> > <HTTPSampler2>
> >
> > </HTTPSampler>
> >  =>
> > </HTTPSampler2>
> >
> > <stringProp
> > name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H
> > TTPSampler</stringProp>
> > =>
> > <stringProp
> > name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H
> > TTPSampler2</stringProp>
> >
> > <stringProp
> > name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu
> > i.HttpTestSampleGui</stringProp>
> > =>
> > <stringProp
> > name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu
> > i.HttpTestSampleGui2</stringProp>
> >
> >
> > I derived these by creating two test plans, one with a single HTTP
> > Sampler, and another with HTTP Sampler HTTPClient (using the same
> > element name), and then doing a comparison.
> >
> > [...]
> >
> > ---------------------------------------------------------------------
> > 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
> 
>

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


Re: Memory leaks - large and uncollected

Posted by Jon Andersen <ja...@umich.edu>.
I tried using HTTPSampler2 as suggested.  However, now there is another  
problem, which shows up even without SSL.  Once I switch to  
HTTPSampler2, cookies or redirects aren't handled properly anymore.   
The exact same script works fine with HTTPSampler, but with  
HTTPSampler2, the cookies fail.

I'm seeing the same JSESSIONID cookie being set over and over again,  
with new values.  JMeter, instead of replacing the cookie each time, is  
appending a new cookie with the same name and the new value.  So the  
same-named cookies accumulate over each request.

Does this HTTPSampler2 cookie bug sound familiar to anyone?

Here is my script that generates the errors, and the results, if  
someone can take a look at it:

http://www.umich.edu/~janderse/sakai/resultstree.jtl
http://www.umich.edu/~janderse/sakai/test.jmx

Thanks,

-Jon Andersen
Software developer
734-260-6083 (work)
734-646-5577 (home)
Digital Media Commons - Duderstadt Center
University of Michigan

On Aug 3, 2005, at 7:02 PM, sebb wrote:

> On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
>> Peter,
>>
>> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I  
>> ran
>> the same script without SSL, and don't see the memory usage growing.
>>
>> Is there some way to switch from the default "HTTP Request"
>> implementation to the "HTTP Request HttpClient" implementation without
>> rewriting the script?  Do both use the same configuration, so I could
>> do a search-n-replace?
>
> Yes, if using 2.0.3, just perform the following changes:
>
> <testelement  
> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
> becomes:
> <testelement  
> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">
>
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler</property>
> becomes
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler2</property>
>
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui</property>
> becomes
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui2</property>
>
> If you are using 2.1, then the set of changes is similar:
>
>
> <HTTPSampler>
>  =>
> <HTTPSampler2>
>
> </HTTPSampler>
>  =>
> </HTTPSampler2>
>
> <stringProp  
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler</stringProp>
> =>
> <stringProp  
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler2</stringProp>
>
> <stringProp  
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui</stringProp>
> =>
> <stringProp  
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui2</stringProp>
>
>
> I derived these by creating two test plans, one with a single HTTP
> Sampler, and another with HTTP Sampler HTTPClient (using the same
> element name), and then doing a comparison.
>
> [...]
>
> ---------------------------------------------------------------------
> 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 leaks - large and uncollected

Posted by Jon Andersen <ja...@umich.edu>.
I'm finding another bug with using HTTPSampler2 and SSL.

With HTTPSampler, I installed a certificate using "keytool", to allow  
SSL to a server that didn't have a trusted certificate.  That worked.

However, it appears that HTTPSampler2 is not finding this certificate.   
Here is the error when I try to use HTTPSampler2 + SSL:

javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate
found
        at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Unknown  
Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
        at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown  
Source)
        at  
org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(H 
ttpConnection.java:1368)
        at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
        at java.io.BufferedOutputStream.flush(Unknown Source)
        at  
org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(Ht 
tpConnection.java:799)
        at  
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase 
.java:2277)
        at  
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBa 
se.java:2657)
        at  
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java 
:1093)
        at  
org.apache.jmeter.protocol.http.sampler.HTTPSampler2.sample(HTTPSampler2 
.java:478)
        at  
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSampl 
erBase.java:590)
        at  
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSampl 
erBase.java:578)
        at  
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:281)
        at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: No trusted
certificate found
        at  
sun.security.validator.SimpleValidator.buildTrustedChain(Unknown  
Source)
        at sun.security.validator.SimpleValidator.engineValidate(Unknown  
Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at  
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unk 
nown
Source)
        at  
com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unk 
nown
Source)
        ... 19 more

-Jon Andersen
Software developer
734-260-6083 (work)
734-646-5577 (home)
Digital Media Commons - Duderstadt Center
University of Michigan

On Aug 3, 2005, at 7:02 PM, sebb wrote:

> On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
>> Peter,
>>
>> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I  
>> ran
>> the same script without SSL, and don't see the memory usage growing.
>>
>> Is there some way to switch from the default "HTTP Request"
>> implementation to the "HTTP Request HttpClient" implementation without
>> rewriting the script?  Do both use the same configuration, so I could
>> do a search-n-replace?
>
> Yes, if using 2.0.3, just perform the following changes:
>
> <testelement  
> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
> becomes:
> <testelement  
> class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">
>
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler</property>
> becomes
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler2</property>
>
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui</property>
> becomes
> <property xml:space="preserve"
> propType="org.apache.jmeter.testelement.property.StringProperty"
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui2</property>
>
> If you are using 2.1, then the set of changes is similar:
>
>
> <HTTPSampler>
>  =>
> <HTTPSampler2>
>
> </HTTPSampler>
>  =>
> </HTTPSampler2>
>
> <stringProp  
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler</stringProp>
> =>
> <stringProp  
> name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.H 
> TTPSampler2</stringProp>
>
> <stringProp  
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui</stringProp>
> =>
> <stringProp  
> name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gu 
> i.HttpTestSampleGui2</stringProp>
>
>
> I derived these by creating two test plans, one with a single HTTP
> Sampler, and another with HTTP Sampler HTTPClient (using the same
> element name), and then doing a comparison.
>
> [...]
>
> ---------------------------------------------------------------------
> 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 leaks - large and uncollected

Posted by sebb <se...@gmail.com>.
On 03/08/05, Jon Andersen <ja...@umich.edu> wrote:
> Peter,
> 
> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I ran
> the same script without SSL, and don't see the memory usage growing.
> 
> Is there some way to switch from the default "HTTP Request"
> implementation to the "HTTP Request HttpClient" implementation without
> rewriting the script?  Do both use the same configuration, so I could
> do a search-n-replace?

Yes, if using 2.0.3, just perform the following changes:

<testelement class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
becomes:
<testelement class="org.apache.jmeter.protocol.http.sampler.HTTPSampler2">

<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</property>
becomes
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler2</property>

<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</property>
becomes
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui2</property>

If you are using 2.1, then the set of changes is similar:


<HTTPSampler>
 => 
<HTTPSampler2>

</HTTPSampler>
 => 
</HTTPSampler2>

<stringProp name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</stringProp>
=>
<stringProp name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler2</stringProp>

<stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</stringProp>
=>
<stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui2</stringProp>


I derived these by creating two test plans, one with a single HTTP
Sampler, and another with HTTP Sampler HTTPClient (using the same
element name), and then doing a comparison.

[...]

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


Re: Memory leaks - large and uncollected

Posted by Peter Lin <wo...@gmail.com>.
glad that fixed your problem. like mike said, the only way is find & replace.

Not to excuse Sun for a lame SSL implementation, but most sites using
SSL typically use hardware acceleartion.  from a price/performance
perspective, using hardware SSL accelerator is much more manageable.
SSL performance is pretty linear and will consume copious amounts of
CPU cycles and RAM, so it can lead to instability of the server. From
past experience with apache and IIS, using software SSL can lead to
server instability.


peter


On 8/3/05, Jon Andersen <ja...@umich.edu> wrote:
> Peter,
> 
> It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I ran
> the same script without SSL, and don't see the memory usage growing.
> 
> Is there some way to switch from the default "HTTP Request"
> implementation to the "HTTP Request HttpClient" implementation without
> rewriting the script?  Do both use the same configuration, so I could
> do a search-n-replace?
> 
> Thanks a bunch!
> 
> -Jon Andersen
> Software developer
> 734-260-6083 (work)
> 734-646-5577 (home)
> Digital Media Commons - Duderstadt Center
> University of Michigan
> 
> On Aug 3, 2005, at 3:14 PM, Peter Lin wrote:
> 
> > I've run optimizeIt on Jmeter about 3 dozen times when I wrote the
> > various samplers like Webservice, jms, accesslog and tomcat monitor.
> > Under normal conditions, JMeter's memory usage is constant. I've run
> > tests using OptimizeIt on JMeter for 500K, 1million and 2 million
> > requests.
> >
> > what I haven't done is try it on SSL. I believe there's a known bug
> > with Sun's SSL implementation which results in connections not closing
> > and resulting in OutOfMemoryException.  The solution to that is to use
> > HttpClient sampler instead of the default one.
> >
> > the default http sampler uses the Sun implementation, which I believe
> > exhibits that behavior. the HttpClient version should perform better.
> > You can also verify this by using HTTP with the same test instead of
> > HTTPS. If the bug doesn't appear in non-secure HTTP, it would support
> > the idea that HTTPS is the cause.
> >
> > I know that some EJB containers use Sun implementation for SSL/HTTPS
> > and they exhibit the same exact bug. If those connections are
> > time_wait and aren't getting cleaned up, it's very likely the known
> > SSL bug.
> >
> > peter
> >
> >
> >
> > On 8/3/05, janderse@umich.edu <ja...@umich.edu> wrote:
> >> Hi,
> >>
> >> I've created a script which generates thousands of HTTP requests; the
> >> script seems to work fine, but I'm seeing a large memory leak in
> >> JMeter
> >> itself.  Before you write this off as a "newbie" question, here is
> >> everything I've tried to do to fix it:
> >>
> >> 1.  Deleting _all_ listeners.  I still see the memory leak, even when
> >> running without any listeners.
> >> 2.  Stopping the test and doing "Clear all".  The memory is _not_
> >> reclaimed, even after a full garbage collection.
> >> 3.  Increasing the memory available to JMeter to 1GB.  As the test
> >> runs,
> >> the memory usage climbs until its doing continuous full garbage
> >> collections.  Eventually an OutOfMemory exception occurs.
> >> 4.  Switching the HTML parser from the default to the
> >> RegexpHTMLParser.
> >> Still see the same memory leak, albeit slower.
> >>
> >> Does this sound familiar to anyone?  It appears to be a slow leak
> >> per-request.  I'm running XP against an SSL-enabled server.  Does SSL
> >> leak
> >> memory per-connection?  "netstat -n" shows thousands of connections -
> >> and
> >> it looks like they don't go away until JMeter quits.
> >>
> >> I only see the leak if I do on the order of 100,000+ HTTP requests.
> >> I can
> >> send interested parties the script to test for themselves.  I'm not
> >> attaching the script now since its 500KB.
> >>
> >> I really need to figure out what is going wrong.  I'm about to
> >> attempt to
> >> run a memory profiler (OptimizeIt) on JMeter to determine where the
> >> leak is
> >> under-the-covers...
> >>
> >> Thanks,
> >>
> >> -Jon Andersen
> >> The Sakai Project
> >> http://www.sakaiproject.org
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> 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 leaks - large and uncollected

Posted by Jon Andersen <ja...@umich.edu>.
Peter,

It appears that Sun SSL -:> OutOfMemoryException is the culprit.  I ran 
the same script without SSL, and don't see the memory usage growing.

Is there some way to switch from the default "HTTP Request" 
implementation to the "HTTP Request HttpClient" implementation without 
rewriting the script?  Do both use the same configuration, so I could 
do a search-n-replace?

Thanks a bunch!

-Jon Andersen
Software developer
734-260-6083 (work)
734-646-5577 (home)
Digital Media Commons - Duderstadt Center
University of Michigan

On Aug 3, 2005, at 3:14 PM, Peter Lin wrote:

> I've run optimizeIt on Jmeter about 3 dozen times when I wrote the
> various samplers like Webservice, jms, accesslog and tomcat monitor.
> Under normal conditions, JMeter's memory usage is constant. I've run
> tests using OptimizeIt on JMeter for 500K, 1million and 2 million
> requests.
>
> what I haven't done is try it on SSL. I believe there's a known bug
> with Sun's SSL implementation which results in connections not closing
> and resulting in OutOfMemoryException.  The solution to that is to use
> HttpClient sampler instead of the default one.
>
> the default http sampler uses the Sun implementation, which I believe
> exhibits that behavior. the HttpClient version should perform better.
> You can also verify this by using HTTP with the same test instead of
> HTTPS. If the bug doesn't appear in non-secure HTTP, it would support
> the idea that HTTPS is the cause.
>
> I know that some EJB containers use Sun implementation for SSL/HTTPS
> and they exhibit the same exact bug. If those connections are
> time_wait and aren't getting cleaned up, it's very likely the known
> SSL bug.
>
> peter
>
>
>
> On 8/3/05, janderse@umich.edu <ja...@umich.edu> wrote:
>> Hi,
>>
>> I've created a script which generates thousands of HTTP requests; the
>> script seems to work fine, but I'm seeing a large memory leak in 
>> JMeter
>> itself.  Before you write this off as a "newbie" question, here is
>> everything I've tried to do to fix it:
>>
>> 1.  Deleting _all_ listeners.  I still see the memory leak, even when
>> running without any listeners.
>> 2.  Stopping the test and doing "Clear all".  The memory is _not_
>> reclaimed, even after a full garbage collection.
>> 3.  Increasing the memory available to JMeter to 1GB.  As the test 
>> runs,
>> the memory usage climbs until its doing continuous full garbage
>> collections.  Eventually an OutOfMemory exception occurs.
>> 4.  Switching the HTML parser from the default to the 
>> RegexpHTMLParser.
>> Still see the same memory leak, albeit slower.
>>
>> Does this sound familiar to anyone?  It appears to be a slow leak
>> per-request.  I'm running XP against an SSL-enabled server.  Does SSL 
>> leak
>> memory per-connection?  "netstat -n" shows thousands of connections - 
>> and
>> it looks like they don't go away until JMeter quits.
>>
>> I only see the leak if I do on the order of 100,000+ HTTP requests.  
>> I can
>> send interested parties the script to test for themselves.  I'm not
>> attaching the script now since its 500KB.
>>
>> I really need to figure out what is going wrong.  I'm about to 
>> attempt to
>> run a memory profiler (OptimizeIt) on JMeter to determine where the 
>> leak is
>> under-the-covers...
>>
>> Thanks,
>>
>> -Jon Andersen
>> The Sakai Project
>> http://www.sakaiproject.org
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>


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


Re: Memory leaks - large and uncollected

Posted by Peter Lin <wo...@gmail.com>.
I've run optimizeIt on Jmeter about 3 dozen times when I wrote the
various samplers like Webservice, jms, accesslog and tomcat monitor.
Under normal conditions, JMeter's memory usage is constant. I've run
tests using OptimizeIt on JMeter for 500K, 1million and 2 million
requests.

what I haven't done is try it on SSL. I believe there's a known bug
with Sun's SSL implementation which results in connections not closing
and resulting in OutOfMemoryException.  The solution to that is to use
HttpClient sampler instead of the default one.

the default http sampler uses the Sun implementation, which I believe
exhibits that behavior. the HttpClient version should perform better.
You can also verify this by using HTTP with the same test instead of
HTTPS. If the bug doesn't appear in non-secure HTTP, it would support
the idea that HTTPS is the cause.

I know that some EJB containers use Sun implementation for SSL/HTTPS
and they exhibit the same exact bug. If those connections are
time_wait and aren't getting cleaned up, it's very likely the known
SSL bug.

peter



On 8/3/05, janderse@umich.edu <ja...@umich.edu> wrote:
> Hi,
> 
> I've created a script which generates thousands of HTTP requests; the
> script seems to work fine, but I'm seeing a large memory leak in JMeter
> itself.  Before you write this off as a "newbie" question, here is
> everything I've tried to do to fix it:
> 
> 1.  Deleting _all_ listeners.  I still see the memory leak, even when
> running without any listeners.
> 2.  Stopping the test and doing "Clear all".  The memory is _not_
> reclaimed, even after a full garbage collection.
> 3.  Increasing the memory available to JMeter to 1GB.  As the test runs,
> the memory usage climbs until its doing continuous full garbage
> collections.  Eventually an OutOfMemory exception occurs.
> 4.  Switching the HTML parser from the default to the RegexpHTMLParser.
> Still see the same memory leak, albeit slower.
> 
> Does this sound familiar to anyone?  It appears to be a slow leak
> per-request.  I'm running XP against an SSL-enabled server.  Does SSL leak
> memory per-connection?  "netstat -n" shows thousands of connections - and
> it looks like they don't go away until JMeter quits.
> 
> I only see the leak if I do on the order of 100,000+ HTTP requests.  I can
> send interested parties the script to test for themselves.  I'm not
> attaching the script now since its 500KB.
> 
> I really need to figure out what is going wrong.  I'm about to attempt to
> run a memory profiler (OptimizeIt) on JMeter to determine where the leak is
> under-the-covers...
> 
> Thanks,
> 
> -Jon Andersen
> The Sakai Project
> http://www.sakaiproject.org
> 
> ---------------------------------------------------------------------
> 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