Fixed unlimited memory growth when inspector is connected.
[Problem] When Remote Web Inspector is connected to a page doing a lot of XHR requests (for example https://www.youtube.com/watch?v=Bey4XXJAqS8_) renderer's memory usage starts to grow with no limit. [Cause] There is a corner case in NetworkResourcesData when the limit of maximum_resources_content_size_ (100.000.000 bytes) is almost reached. When the next request finishes its raw data is replaced with decoded form. The decoded form can be larger that the raw data. Sometimes the difference is so big that it causes the NetworkResourcesData::content_size_ to go above the maximum_resources_content_size_. From now on there is basically no limit in appending requests in NetworkResourcesData as maximum_resources_content_size_ - content_size_ in NetworkResourcesData::EnsureFreeSpace() will give a very large number (unsigned overflow). [Solution] Ensure that after request data is decoded NetworkResourcesData has enough space to store the decoded form. It needs to have at least "decoded size" - "raw size" bytes free. Bug: 1019862 Change-Id: I5adf3aa4a91d01012f8620628f1a442697668105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946476Reviewed-by:Yang Guo <yangguo@chromium.org> Reviewed-by:
Sigurd Schneider <sigurds@chromium.org> Reviewed-by:
Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#739092}
Showing
Please register or sign in to comment