I can't reproduce.
I've created a 2 GB file with dd, hardcoded its name in my script in Re: Download big file in chunks with plack response, executed ulimit -v 1000000 to limit available memory, then in the same shell ran the server as plackup script.pl. From a different terminal I've then ran curl http://localhost:5000 -o /tmp/thing.
Predictably, the server died with "Out of memory". Then, I've commented out the slurp line, as I've suggested earlier. Predictably, the server proceeded to serve the file and didn't die.
What are you actually doing, and what is your exact error message?
(I had to add a line \&return_psgi; for it to work with plackup, and I hardcoded the file name because I'm not aware of a way for a PSGI a handler to get a file name as an argument, so I suspect there is something else in the picture that you're not telling us.)
|Replies are listed 'Best First'.
Re^7: Download big file in chunks with plack response
by Thenothing (Sexton) on Apr 26, 2021 at 09:33 UTC