cgicc-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cgicc-help] [help-cgicc] File upload memory usage


From: Martin Oberhuber
Subject: Re: [Cgicc-help] [help-cgicc] File upload memory usage
Date: Mon, 16 Jul 2018 19:23:29 +0200

Hi all,

after more testing, it turned out my original patch had an issue when there were multiple attachements.
Attached new patch fixes that - it replaces the first patch.

Could it be considered for a future cgicc release?

Thanks,
Martin

On Wed, Jun 27, 2018 at 7:29 PM, Martin Oberhuber <address@hidden> wrote:
Hello Dries, dear cgicc users and maintainers -

Like others before [1][2][3], I have also found cgicc to require
an unreasonable amount of main memory when processing
uploaded 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() can
easily 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 and
fully portable and solves at least part of the problem.
Could it be considered for a future cgicc release?

Thanks,
Martin

[1] https://lists.gnu.org/archive/html/help-cgicc/2018-03/msg00000.html
[2] https://lists.gnu.org/archive/html/help-cgicc/2015-10/msg00000.html
[3] https://lists.gnu.org/archive/html/help-cgicc/2010-09/msg00000.html






--
Martin Oberhuber | Software Architect, Project Lead & Consultant | Austria

Attachment: cgicc-3.2.16-memopt.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]