part.getString will cause OOM without checking maxPostSize, checking maxPostSize first will avoid OOM caused by huge string#419
Conversation
…maxPostSize first will avoid OOM caused by huge string
|
This report, and the proposed solution is invalid. |
|
I adjusted to check the maxPostSize first to avoid the OOM problem, part.getString will trigger OOM when the string is huge. |
|
If part.getString is called before checking maxPostSize, it may trigger OOM. |
|
stack trace: |
|
My solution did not change the original semantics. Please take a closer look. It just adjusted the calling order of part.getString to avoid the OOM problem of large strings. After I compiled tomcat locally and tested it, I solved the OOM problem when part.getString was called in advance for huge strings and insufficient memory. |
|
Re-opening to take another look. |
In our online server, when the client sends a huge string (hundreds of megabytes) to the server via multipart/form-data, OOM occurs, and the maxPostSize check logic is not executed