Add Windows heap trimming tool
This is an experimental tool which will inject a thread into a Chrome process (tested on the browser and GPU process) and run code to call HeapSetInformation with HEAP_OPTIMIZE_RESOURCES_CURRENT_VERSION. This tells Windows to trim unnecessary memory from the heaps in that process. This tool uses sketchy techniques such as copying memory from one executable to another (only works if the code is relocatable and has no external references), VirtualAllocEx, and CreateRemoteThread. This is not for production use. To build run build.bat To run either run it manually (passing the PIDs of the processes of interest) or run trim_loop.bat (passing the PIDs of the processes of interest) to run it every five minutes in a loop. While it sometimes frees non-trivial amounts of memory the savings are not persistent. Bug: 1050059, 982452 Change-Id: I646c515e59598c2c3003500419c154bacd34aeda Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139127 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by:David Bienvenu <davidbienvenu@google.com> Reviewed-by:
Jesse McKenna <jessemckenna@google.com> Reviewed-by:
James Forshaw <forshaw@chromium.org> Cr-Commit-Position: refs/heads/master@{#757644}
Showing
tools/win/trim_heap/OWNERS
0 → 100644
Please register or sign in to comment