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

Move memory stats gathering from polkadot to parity-util-mem #588

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

koute
Copy link
Contributor

@koute koute commented Sep 15, 2021

I want to switch the jemalloc crate from jemallocator to tikv-jemallocator, however polkadot directly depends on the jemalloc-ctl crate which makes such a switch a breaking change (since jemalloc-ctl pulls the original jemalloc-sys, and you can't have two jemallocs compiled in at the same time).

So this moves that jemalloc-specific chunk of code (originally introduced in paritytech/polkadot#3612) from polkadot here, and abstracts it away.

Copy link

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Thanks! Could you also update the changelog in parity-util-mem?

parity-util-mem/src/memory_stats_noop.rs Show resolved Hide resolved
@koute
Copy link
Contributor Author

koute commented Sep 15, 2021

Thanks! Could you also update the changelog in parity-util-mem?

Sure thing!

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

There are a few undocumented items and I think I agree with @ordian about preferring an Err to a panic.

parity-util-mem/src/memory_stats_noop.rs Show resolved Hide resolved
@drahnr
Copy link

drahnr commented Sep 15, 2021

There are a few undocumented items and I think I agree with @ordian about preferring an Err to a panic.

Since one cannot create the item itself (fn new() always returns Err), I think a panic is fine, maybe a unreachable!() instead though

@koute
Copy link
Contributor Author

koute commented Sep 15, 2021

There are a few undocumented items

If by undocumented you mean the lack of doc comments then yes, these are deliberately undocumented since the documentation's supposed to be on the facade (since that's what's supposed to define the public API; not much point in copy-pasting exactly the same thing for crate internal structures).

and I think I agree with @ordian about preferring an Err to a panic.

Well, it's not supposed to be ever called, which is why I think an unimplemented is apt there, but I don't really have a strong opinion about this so whatever you decide I'm fine with it.

@ordian
Copy link
Member

ordian commented Sep 15, 2021

FWIW, I'm fine with the current impl, was reviewing it in the pre-coffee state at first 😅

@koute
Copy link
Contributor Author

koute commented Sep 15, 2021

Okay, I've updated the changelog (and I've also backfilled the release date of the 0.10.0). I've also put today's date for 0.10.1, since I'd like to immediately release it and whip up a polkadot PR to align it to these changes.

If you'd like anything else changed now's the time to speak up. (:

@ordian ordian merged commit 3030a6d into paritytech:master Sep 15, 2021
@ordian
Copy link
Member

ordian commented Sep 18, 2021

I've also put today's date for 0.10.1, since I'd like to immediately release it and whip up a polkadot PR to align it to these changes.

Sorry, do you want me to publish it? Maybe I misinterpreted your message. But feel free to do it, you should have the rights to publish to crates.io.

@koute
Copy link
Contributor Author

koute commented Sep 18, 2021

Sorry, no, I'll do it myself next week; I was just busy with the RPC memory leak, which is why I didn't do it immediately. (:

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.

4 participants