Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMeasure cache memory usage #19251
Measure cache memory usage #19251
Comments
|
Required work:
|
|
Run Servo with |
|
I would want to try this. |
|
Great! Please ask questions if anything is unclear. |
|
After changing
to
I get this error message during the build:
I already found out that there is a MallocSizeOf in the crate malloc_size_of. But when I import it with
it says
What am I missing here? |
|
For one thing, that error message says |
The sender is a
I see that run_with_memory_reporting must be called on profiler_chan here, but the function also takes some arguments (reporter_name, channel_for_reporter and msg), and I currently don't know where to get them inside the thread. |
|
@jdm |
|
The other parameters are:
|
|
@jdm
to this:
I'm passing
Do you have a suggestion what I can do to fix this error? |
|
Oh, you can use |
|
Thanks @jdm, that worked perfectly. I still got some questions though (sorry for that, I'm still learning ;-)). You said in your initial post
since the sender is of the type Also, What's the right way to create the channel and use the sender and receiver here? |
|
The error message can be avoided if you implement the trait that it is complaining about. |
|
Oh, and as for how to use it - add the new receiver to the receiver set, and check for the receiver's id along with the existing ones inside the loop in ResourceChannelManager::start. |
|
Hi @olmanz how is this going? Is there anything we can help with? |
|
@avadacatavra You can see the current status here on this branch of my fork: https://github.com/olmanz/servo/commits/issue19251 Currently, I'm getting this error message:
|
|
Ah, my mistake. If you do |
|
@olmanz Are you still working on this? |
|
Hello @jdm, |
|
This looks interesting :D As a beginner, can I attempt to solve this? |
|
@pandusonu2 Yes, and please ask questions about anything that's unclear! |
|
@pandusonu2 Are you still working on this? Have you made any progress? |
|
@jdm Yeah! I'm trying to work to understand as much as possible. I refered to @olmanz branch and I understood the following changes have been implemented by him
I'm kinda getting errors at mem_profile_chan.run_with_memory_reporting(....) |
|
Heyo, Although I am not assigned, is it possible for me to look into this too? |
|
@pandusonu2 Are you working on this? Is it okay if I give it an attempt? @jdm |
|
@modal17 Did you delete a question that you previously asked? I swear I remember seeing one about what to measure. |
|
@jdm I did! I have the memory reporter displaying messages when running with |
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.
Measure cache memory usage <!-- Please describe your changes on the following line: --> - [X] make the memory cache data structure derive MallocSizeOf - [X] add a new IpcReceiver argument to ResourceChannelManager::start that is used for listening to messages from the memory profiler (it must correspond with this sender) - [X] use run_with_memory_reporting in the network code to register a memory reporter for that thread - [X] when a message from the memory profiler arrives, create a report that includes that size of the public and private http caches --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #19251 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20391) <!-- Reviewable:end -->
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.
Measure cache memory usage <!-- Please describe your changes on the following line: --> - [X] make the memory cache data structure derive MallocSizeOf - [X] add a new IpcReceiver argument to ResourceChannelManager::start that is used for listening to messages from the memory profiler (it must correspond with this sender) - [X] use run_with_memory_reporting in the network code to register a memory reporter for that thread - [X] when a message from the memory profiler arrives, create a report that includes that size of the public and private http caches --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #19251 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20391) <!-- Reviewable:end -->
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.
Measure cache memory usage <!-- Please describe your changes on the following line: --> - [X] make the memory cache data structure derive MallocSizeOf - [X] add a new IpcReceiver argument to ResourceChannelManager::start that is used for listening to messages from the memory profiler (it must correspond with this sender) - [X] use run_with_memory_reporting in the network code to register a memory reporter for that thread - [X] when a message from the memory profiler arrives, create a report that includes that size of the public and private http caches --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #19251 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20391) <!-- Reviewable:end -->
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.
After #18676 merges we'll want to add support for measuring how much memory is in use by cached responses.