-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dbus-broker consumes more memory than dbus-daemon #377
Comments
Hi! Thanks for the report! Can you elaborate on your tests and numbers a bit? Like how big is the absolute memory usage in your tests? What kind of memory did you measure (resident, virtual, etc.)? What did the test environment look like (full distro? how many connections? ...)? Also, what kind of numbers did you expect? Is this memory usage actually a problem? How much of the overall memory consumption is this? What would the ideal consumption look like to you? Generally, there should not be much of a difference between dbus-daemon and dbus-broker. The only real knob to work with is the size of the staging message buffers. dbus-daemon might release them on every transaction, but dbus-broker retains them and (I think) reserves a page per connection. This can certainly be tweaked, but I would like to have some actual numbers to judge. |
Thank you for your reply and let me share some more details. I believe memory usage can be viewed from two perspectives: the overall system and the internal usage of D-Bus(dbus-broker and dbus-daemon). When I initially mentioned that dbus-broker uses 8MB more memory than dbus-daemon, I was referring to the overall system memory consumption. When comparing the internal consumption of dbus-broker and dbus-daemon, it seems that dbus-broker uses about 4.5MB more memory than dbus-daemon (This can vary depending on the situation and let's just say 5MB for simplicity). Discussing the overall system consumption results can be more complicated, so for now let's just focus specifically on the internal memory consumption results of dbus-broker and dbus-daemon. The test is carried out below conditions:
The test is carried out below order:
Through testing, dbus-broker consumes around 12MB and dbus-daemon consumes around 7.5MB(about 4.5MB difference). The dbus-broker figure is the sum of dbus-broker and dbus-broker-launch. I was hoping that dbus-broker would have less memory consumption, or at most 1-2 MB more. However, I think that the 5MB increase in memory usage due to IPC could be burdensome for embedded systems. Could you please explain where in the code I can find and adjust the staging message buffers? If you need any further information, please let me know. |
Thanks for the details! The strategy sounds plausible to me, but I would definitely say that full system benchmarks are very valid plans as well. Also, you might wanna try adding USS numbers to your graphs, since they usually correlate more with actual runtime allocations. RSS/PSS can still differ between systems, depending on which (unrelated) software you run. For instance, if you run many other applications that use I think the buffer you want to experiment with is defined in |
As per your suggestion, I reduced IQUEUE_RECV_MAX to 128 and conducted tests. The results show that memory consumption decreased by approximately 600KB to 1MB. However, this improvement was not still enough to meet the requirements. Secondly, as per your suggestion, I added USS and included a new graph below. The graph shows a significant difference in private dirty memory between dbus-daemon and dbus-broker, which may indicate significant memory allocations and changes in the stack or heap. If you have any additional suggestions or ideas for further testing, I would appreciate your advice. |
Hi, can you elaborate at which point of the bemchmark your graph is drawn? While it is running, or when done? |
As can be seen in the image above, the biggest factor contributing to the difference in memory usage between dbus-daemon and dbus-broker is the private dirty memory. Additionally, there is no significant change in memory usage before(test result from No.1), during(test result from No.3) the test. It seems that dbus-broker has already secured a large buffer size before the test starts. So, I investigated the private dirty area as follows: The difference in binary size below is not big . Is there anything else worth trying? |
Can you measure this directly on dbus-broker, rather than the combination of the launcher+broker? |
dbus-broker seems to offer significantly better performance than dbus-daemon. However, this improved performance comes at the cost of higher memory usage compared to dbus-daemon. In my comparison tests with dbus-broker and dbus-daemon, I observed that dbus-broker consumes approximately 8MB more memory. This may not be a problem at all on a desktop, and may not be noticeable at all, but it can be a burden on the system on an embedded system. Is this an issue only I have, or have you experienced similar issues?
Could you please let me know if there is any configuration or other way to reduce or control the memory usage of dbus-broker?
Any ideas or advice would be appreciated.
The text was updated successfully, but these errors were encountered: