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

enable jemalloc #277

Merged
merged 3 commits into from
Dec 3, 2024
Merged

enable jemalloc #277

merged 3 commits into from
Dec 3, 2024

Conversation

shiqicao
Copy link
Contributor

@shiqicao shiqicao commented Nov 26, 2024

  • enable jemalloc
  • check jemalloc is actually used,
    • extract sui binary from ghcr.io/shinamicorp/sui:testnet-v1.38.0
    • install libjemalloc-dev
    • set LD_PRELOAD to /usr/lib/x86_64-linux-gnu/libjemalloc.so
    • run perf record -g --call-graph dwarf -F 4000 -o perf.data sui --version
    • run perf script | grep jemalloc, found jemalloc
    • unset LD_PRELOAD
    • run perf record -g --call-graph dwarf -F 4000 -o perf.data sui --version
    • run perf script | grep jemalloc, not found jemalloc

[sc-3882]

@shiqicao shiqicao changed the title jemalloc test enable jemalloc Nov 28, 2024
Dockerfile Outdated
procps \
&& \
rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/libjemalloc.so /usr/lib/libjemalloc.so

ENV LD_PRELOAD=/usr/lib/libjemalloc.so
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you can simply install libjemalloc2 and do LD_PRELOAD=libjemalloc.so.2. Then you don't need dpkg-dev nor the manual symlink.

Copy link
Contributor Author

@shiqicao shiqicao Dec 2, 2024

Choose a reason for hiding this comment

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

directly installing libjemalloc2 still installed under x86_64-linux-gnu

> sudo apt-get install libjemalloc2

> dpkg-query -L libjemalloc2
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
/usr/share
/usr/share/doc
/usr/share/doc/libjemalloc2
/usr/share/doc/libjemalloc2/README
/usr/share/doc/libjemalloc2/changelog.Debian.gz
/usr/share/doc/libjemalloc2/copyright

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I understand, but the path prefix is auto inferred based on the current platform so you just need the relative path.

@shiqicao shiqicao merged commit fcedea8 into main Dec 3, 2024
4 checks passed
@shiqicao shiqicao deleted the shiqi/jemalloc branch December 3, 2024 21:02
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.

2 participants