|
From: | Martin Oberhuber |
Subject: | Re: [Cgicc-help] [help-cgicc] File upload memory usage |
Date: | Mon, 16 Jul 2018 19:23:29 +0200 |
Hello Dries, dear cgicc users and maintainers -Like others before [1][2][3], I have also found cgicc to requirean unreasonable amount of main memory when processinguploaded files. In my case (cgicc-3.2.16, gcc-4.8.1, ARM Linux)a 100MB uploaded file required 300MB main memory.I debugged the case and noticed that parseMIME() caneasily avoid one of the two string::substring() usages,thus cutting down memory usage to 200MB.I didn't pursue it further than that, though I found Dries'arguments about copy-on-write in the string class very interesting.I suppose that c++17 string_view would also be interesting.I believe that my patch (attached) is simple, safe andfully portable and solves at least part of the problem.Could it be considered for a future cgicc release?Thanks,Martin
Martin Oberhuber | Software Architect, Project Lead & Consultant | Austria
cgicc-3.2.16-memopt.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |