Implement MemoryDumpProvider(s) for code cache in renderers |
|||
Issue descriptionJust out of curiosity: how much memory does code cache consume in the field? If it is >1 MiB often ehough, we can think of helping it be more sensitive to low memory notifications. Maybe. My brief look reveals that some code cache is attached to resources, like: blink::Resource -> cache_handler_ -> blink::CachedMetadata. Seems that a MemoryDumpProvider for those CacheMetadata attached to memory UMA (potentially easily UKM-able) would be a good approach. mythria/rmcilroy: WDYT? Are there more copies to take care of? Does code cache get copied to v8 heap?
,
Jan 4
Yes, Resource->cache_handler_ is the one that stores the code cache in memory. V8 also stores the deserialized code caches in its compilation caches in memory [1]. The compilation caches cache any code that was generated/deserialized. The deserialized code is on the V8 heap. It doesn't maintain the serialized version though. I am not sure about how much memory is consumed by code cache though, but I was curious too. I was wondering if we should even store it in memory on blink side since V8 already stores the deserialized code cache in its compilation cache. I was interested in seeing how often we have served the code cache from memory (not fetching from the disk) when there was no entry in the compilation cache. The V8.CodeCacheSizeRatio is the ratio of serialized code to the size of the script [2]. That gives a nice approximation of the size of cache we are producing but may be a bit difficult to estimate how much of this we are holding in memory. This is also not a right measure for the size of serialized vs deserialized code cache size since most of the script is not compiled. [1] https://cs.chromium.org/chromium/src/v8/src/compilation-cache.h?gsn=compilation_cache_&g=0&l=153 [2] https://cs.chromium.org/chromium/src/third_party/blink/renderer/bindings/core/v8/v8_code_cache.cc?q=V8.CodeCacheSizeRatio&sq=package:chromium&g=0&l=208
,
Jan 4
,
Yesterday
(41 hours ago)
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ssid@google.com
, Jan 3