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

[feature]: Use jemalloc in Unix & able to control dump heap profile using http interface #260

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ByteYue
Copy link
Contributor

@ByteYue ByteYue commented Mar 7, 2025

PR Description

[Briefly describe your changes]
Issue Number: closes #xxx

Users can use the curl command to access the /mem_prof HTTP interface (assuming it's on port 9000) to control whether heap profiling is printed. For example:

curl -X POST -H "Content-Type: application/json" -d '{"start": true}' http://127.0.0.1:9001/mem_prof

Note Users need to ensure that jemalloc-profiling is enabled during compilation. This can be done by using make FEATURE="api/jemalloc-profiling". Also, note that this project uses tikv-jemalloc. Users need to set the following environment variables before starting the program for it to take effect:

export _RJEM_MALLOC_CONF=prof:true,lg_prof_interval:30,lg_prof_sample:21,prof_prefix:${USER_PREFIX}

(Note that the directory corresponding to this prefix must already exist).

Tested?

  • Yes
  • No

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