jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Petersen" <>
Subject SV: Saving large (>500Mb) http response to a file.
Date Fri, 08 Jun 2012 07:12:34 GMT
Hi Sebb.

That was what I was afraid of.

I have not looked at the JMeter code yet, but it looks like the sampler stores the entire
response internally before making a copy for the listener that could store the data.

For this to work I guess the sampler must store the data itself, but that could hurt the
modularity of JMeter.

Because of the time I have left, I might not have the time dig into this in details through.

Thank you,

-----Oprindelig meddelelse-----
Fra: sebb []
Sendt: to 07-06-2012 17:41
Til: JMeter Users List
Emne: Re: Saving large (>500Mb) http response to a file.
On 7 June 2012 14:04, Carsten Petersen <> wrote:
> Hi.
> I am trying to verify a large (>500Mb) response from a HTTP request, but whenever
I run my TestPlan
> the thread fails after running out of memory.
> I have added a "Save Responses to a file" Listener, but it looks like it is the HTTP
Request sampler that
> fails when handling all the data in memory after the reception completes - see error
ourput below.
> Console window output:
>  java.lang.OutOfMemoryError: Java heap space
>  Dumping heap to java_pid1912.hprof ...
>  Heap dump file created [558234258 bytes in 6.291 secs]
> JMeter log file output:
>  2012/06/07 14:51:53 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.OutOfMemoryError:
Java heap space
>        at java.util.Arrays.copyOf(Unknown Source)
>        at Source)
>        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(
>        at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(
>        at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(
>        at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(
>        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(
>        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
>        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
>        at org.apache.jmeter.threads.JMeterThread.process_sampler(
>        at
>        at Source)
> I have already increased the heap allocation to its max on my hardware (-Xmx1G), but
without success. I guess I could
> add memory, but since I have to run multiple downloads at the same time, it does not
look realistic.
> I can enable the "Save response as MD5 hash" option and have my TestPlan succeed, but
then the output file from the
> run only contain the MD5 hash and since my response data is somewhat dynamic it is of
no real use.
> I can see that JMeter allows a large file to be uploaded by reading it as needed during
transmission, so I guess I need
> the reverse of this i.e. store the response to a file while receiving it without keeping
it in memory. I guess something
> like having the "Save response as MD5 hash" option dump the data to a file after its
calculation are done.
> Does anybody know how I can do this ?

I think this will need a change to the JMeter HttpSampler code.
Listeners can only save what the sampler stores in the sample result.

I suggest you file an enhancement request in Bugzilla.

> Thanks in advance,
> Carsten.
> P.S. I am using the following JMeter:
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: Version 2.7 r1342410
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: java.version=1.7.0_04
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: HotSpot(TM) Client VM
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: 7
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: os.arch=x86
>  2012/06/07 14:20:45 INFO  - jmeter.JMeter: os.version=6.1

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message