Q:

When does Jmeter releases object?

I am working on load testing Video streaming, I have observed that when we execute Jmeter to download any video files it gets downloaded in the Heap memory and many times it does not releases the heap memory, this causes JVM out of memory issues.
I have also observed that when we select option “Save as MD5 Hash option”, proper GC cycle kicks in and Jmeter does through JVM out of memory error.
Could you please help me in knowing:

How does Jmeter handles the object?
When does it releases the object? and 
When Save as MD5 option is selected what difference it makes during execution and releasing the option?

A:

The difference is that if you tick Save as MD5 JMeter stores only MD5 hash of the response which is a relatively short string while in the opposite case JMeter stores the whole response in memory so the options are in:

Use MD5 hashes in combination with MD5Hex Assertion if you need to check content integrity
Go for distributed testing, by default JMeter remote engines do not store response data so it will be discarded (
Increase JVM Heap space allocated to JMeter so the responses will fit
Manually discard response data using JSR223 Listener and code like
prev.setResponseData('dummy','UTF-8')

