Measure cache memory usage (#19251):

Made the memory cache data structure derive MallocSizeOf, along with
manual size_of() implementations in malloc_size_of.

Added a Measurable struct that acts as a container for fields size_of() can be called for.

Added a new IpcReceiver used for listening to messages from the memory profiler,
and used run_with_memory reporting to register a memory reporter in the thread.
Now when a message from the memory profiler arrives, report includes sizes of public and private http caches.

Updated test file.
This commit is contained in:
modal-d17 2018-02-20 16:00:16 -05:00 committed by modal17
parent d232705106
commit af445a357d
13 changed files with 312 additions and 76 deletions

View file

@ -462,6 +462,7 @@ fn create_constellation(user_agent: Cow<'static, str>,
new_resource_threads(user_agent,
devtools_chan.clone(),
time_profiler_chan.clone(),
mem_profiler_chan.clone(),
config_dir);
let font_cache_thread = FontCacheThread::new(public_resource_threads.sender(),
webrender_api_sender.create_api());