Skip to content
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

chore: allow slow and precise memory measurement of an object #4160

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Nov 20, 2024

Specifically fixes "MEMORY USAGE" for lists.

The mi_collect call may actually fix #3776 At least in my tests it stopped crashing.

@romange romange requested a review from chakaz November 20, 2024 19:26
@@ -291,7 +297,7 @@ static_assert(sizeof(CompactObj) == 18);

namespace detail {

size_t RobjWrapper::MallocUsed() const {
size_t RobjWrapper::MallocUsed(bool slow) const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but isn't very elegant. Why don't you want to cache this size on the object like we do elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am planning to, once we switch to QList. Also with streams it may take some time as well.
Meanwhile I would like to have at least the "slow" variants because performance is not an issue for "memory usage".

Specifically fixes "MEMORY USAGE" for lists.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
@romange romange merged commit 581cfbf into main Nov 21, 2024
9 checks passed
@romange romange deleted the QL1 branch November 21, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test failed replication_test.py::test_take_over_counters
2 participants