I was unnecessarily hanging on to these SampleResult objects, so have cleaned 
that up, but the question on how to know that the thread has made its last 
iteration still stands - any ideas or is this something for dev? It's version 
3.3

> -----Original Message-----
> From: Antony Bowesman [mailto:antony.bowes...@williamhill.com.au]
> Sent: Tuesday, 3 April 2018 2:04 PM
> To: JMeter Users List <user@jmeter.apache.org>
> Subject: Cleaning up memory used by an HTTPSampleResult
> 
> I've been investigating a memory leak and it seems that under certain
> circumstances when I get a redirect, I end up downloading a bunch of
> embedded resources I don't need. In this case, these HTTPSampleResult
> objects end up being part of my JavaSampler instance, which is added to the
> TEAR_DOWN_SET in the JavaSampler jmeter class.
> 
> In this particular test, the Java Sampler only executes once and so the
> HTTPSampleResult objects only get cleaned up at the end of the test, when
> my teardownTest() method is called. However, it also applies to samplers
> that are called in a OnceOnlyController, which in my case happens to be
> Login.
> 
> I have a couple of solutions, i.e. I know I can prevent the follow redirects 
> to
> stop the symptoms of this behaviour and I can also put in a hack that will
> clean up the resources by other samplers in the same thread, but the bigger
> picture of how to prevent the basic memory leak issue that appears to exist
> for these hanging HTTPSampleResult objects. The main culprit is the
> responseData byte[], which basically holds the entire response payload.
> 
> There seems to be no message I can listen for
> (LoopIterationListener/TestIterationListener) to indicate a thread has made
> its last iteration.
> 
> Is there any way to clean up a thread's resources when it is done with. I 
> can't
> do the cleanup during the iteration as there may be listeners that want the
> results.
> 
> Thanks
> Antony


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

Reply via email to