You can clone with
HTTPS or Subversion.
Conditional responses (Response.make_conditional()) cause the iterator to be converted to a list (which stores the contents of the file in memory) and then ''.join() is used on the list (!!) which stores the contents of the file in memory AGAIN so Flask can use len() to determine content length. So for a short time it uses twice the item size in memory until the list conversion function returns the string from ''.join() and the original list is destroyed.
This isn't mentioned anywhere in the Flask docs, and can be avoided by calculating the file size and setting the Content-Length header using os.path.getsize() or fp.seek() and fp.tell() before rv.make_conditional is called.
is this still true?
If I'm reading it right, the changes made in mitsuhiko/werkzeug@e7f0ef4 mostly alleviate this by using a generator to add up the length of the file's lines instead of reading the whole file into a string at once.
@qxcv, do you think that addresses your issue?
Yes, that should fix the issue. I just tested with 0.10.1 and send_file no longer seems to cause an issue. Here is a quick test script I wrote to verify.