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

perf2bolt: huge RAM consumption #61711

Open
zamazan4ik opened this issue Mar 26, 2023 · 7 comments
Open

perf2bolt: huge RAM consumption #61711

zamazan4ik opened this issue Mar 26, 2023 · 7 comments
Labels

Comments

@zamazan4ik
Copy link

zamazan4ik commented Mar 26, 2023

Hi!

I am trying to optimize YDB database (https://github.com/ydb-platform/ydb) with Bolt. I have run YDB binary (ydbd) with perf record, then I want to convert it to Bolt format with perf2bolt. Unfortunately, perf2bolt uses more than 30 Gib RAM and is OOM killed since I have only 32 Gib RAM.

Is there a way to reduce memory usage?

My setup:

  • OS: Fedora 37
  • Linux kernel: 6.2.7
  • Compiler: clang-15 from Fedora packages (clang 15.0.7 (I've patched a few sources to support this compiler)
  • Hardware: Ryzen 9 5900X, 32 Gib RAM, SSD
  • Bolt version: built manually from the main branch with Clang 15.0.7 in Release mode

A related issue in YDB upstream: ydb-platform/ydb#140

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 26, 2023

@llvm/issue-subscribers-bolt

@maksfb
Copy link
Contributor

maksfb commented Mar 26, 2023

Could you try —strict=0 option?

@zamazan4ik
Copy link
Author

zamazan4ik commented Mar 26, 2023

@maksfb yes, it reduces memory usage significantly. Didn't hear about this option before... Is it somehow related to the "lightweight" BOLT approach (I have read about it recently in the latest Propeller paper)?

@maksfb
Copy link
Contributor

maksfb commented Mar 27, 2023

In a nutshell, yes. In some, relatively rare cases, --strict=1 allows to capture/optimize more functions, but the drawback is that it disables the lite mode.

@zamazan4ik
Copy link
Author

@maksfb could you please mention this information somewhere in the BOLT' README file? Probably something like "if you want to reduce memory consumption during BOLT optimization - you could try to use -strict=0 option". Also, could be useful to put this info into llvm-bolt -help too.

It would users in the future quicker resolve possible issues. Thanks!

@ptr1337
Copy link
Contributor

ptr1337 commented Apr 5, 2023

@zamazan4ik

How big is your perf.data?

I already had a discussion in the llvm discord about that issue and according them is not that much profile data (e.G 2GB or more) not required. This would also fix your issue without disabling strict and lite.

@zamazan4ik
Copy link
Author

How big is your perf.data?

236 Mib. If you need, I can share this file - if it could help for debugging purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants