This page surveys and organizes efforts against memory bloat in Chrome.
Memory BloatThere are two main types of memory issues. One is memory safety issues like use-after-free and buffer-overflow. Many tools are your friends like ASAN and Dr. Memory for memory safety issues. Other memory issues are memory bloat issues that simply mean too large memory usage. We need completely different efforts and toolsets against memory bloat issues than memory safety issues.
LeaksLeaks are a part of memory bloat issue. Some leaks can be found by some memory safety tools like Dr. Memory, especially in case malloc'ed objects remain to the end. We however have many other types of practical leaks. For example, forgetting to release a reference-counted pointer to a bulk of objects may practically cause a leak. It cannot be caught as it's eventually released at the very end. Such leaks are observed by tools against memory bloat issues.
Which is Bloating: Native or JavaScript?Memory bloat issues are usually observed either in two places: native (C++) heap and/or JavaScript heap. Your first action is to identify which is bloating. A JavaScript value window.performance.memory (visible from DevTools) would help to identify. Chromium is usually blamed when the bloat is observed in native heap, and the Web application is usually in charge of bloat in JavaScript heap. The difficulty is that it's not always, but identifying which is bloating must help to track the issue.
File a BugPlease file a bug with a "Performance-Memory" label for memory bloat issues.
Efforts and ToolsCategorizing the EffortsMemory bloat issues are complicated, and we need to observe them from various viewpoints: testing, reproducing, breaking-down, leaking... The following is a trial to categorize existing efforts. Feel free to edit the table for better categorization.
Feel free to add your efforts in the list. The description is nice to have its advantage and also DISADVANTAGE (limitation) so that we can easily understand what is missing and needed to reduce memory usage. Just a plan is welcome in the list! Testing and Benchmarking
Runtime Bloat Detection
Implemented http://crbug.com/246125 to replace Memory Purger. Real-world Data CollectionMemory bloat issues are happening in the real world, but it is hard to reproduce them in our "lab" (tests and buildbots). The efforts are to reproduce real-world memory bloat issues by collecting more real-world memory usage data.
Top-down Analysis"Top-down" means breaking down the entire (or a large part of) memory usage into some parts.
Bottom-up Analysis"Bottom-up" means finding individual specific memory problems like leaks, cyclic reference and else. We have some existing leak finding tools like Massif (in Valgrind) and heap-checker (in gperftools)
Life Prolongation
DevTools: for Web-application side
Allows to take JS heap snapshots, analyze memory graphs and compare snapshots with each other.
Analysis Reports and Case StudiesLet's collect public reports of any kind of memory usage analysis. |
For Developers >