net/http: ParseMultipartForm using 8x maxMemory #53109
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have created a small upload tool for the caddy v2 server
https://github.com/git001/caddyv2-upload
I set the MaxBytesReader ( https://github.com/git001/caddyv2-upload/blob/main/upload.go#L125 ) and ParseMultipartForm ( https://github.com/git001/caddyv2-upload/blob/main/upload.go#L126 ) to limit the memory usage.
What we have observed is that even when we limit the
ParseMultipartForm()
maxMemory parameter is the initial memory consumption 7-8 times higher then the given maxMemory.git001/caddyv2-upload#2
What did you expect to see?
We expect that the memory usage is not 7-8 times higher at the initial upload phase then the configured one for ParseMultipartForm
What did you see instead?
We see that the memory usage 7-8 times higher then configured maxMemory in ParseMultipartForm
The text was updated successfully, but these errors were encountered: