Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat: supporting release all tcmalloc reserved but not used memory #864

Merged
merged 3 commits into from
Jul 28, 2021

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Jul 22, 2021

As pegasus#789 shows, this pull request support releasing all tcmalloc reserved not-used memory by remote command.
NOTICE: Strongly recommend using this command when seriously lack of memory, releasing all reserved memory may affect performance.

I test this function on onebox:

>>> remote_command -t replica-server replica.release-all-reserved-memory
COMMAND: replica.release-all-reserved-memory

CALL [replica-server] [ip:por1] succeed: OK, release_bytes=933888
CALL [replica-server] [ip:por2] succeed: OK, release_bytes=6512640
CALL [replica-server] [ip:por3] succeed: OK, release_bytes=6709248

Succeed count: 3
Failed count: 0

The log is like:

D2021-07-23 10:22:36.125 (1627006956125927036 7178) replica.default1.03001bf2000100c4: replica_stub.cpp:2724:gc_tcmalloc_memory(): Memory release started, almost 933888 bytes will be released

The perf-counter is like:

[replica*eon.replica_stub*tcmalloc.release.memory.size, NUMBER, 933888.00]

@hycdong hycdong marked this pull request as ready for review July 23, 2021 01:12
@Smityz Smityz added the type/remote-command Add a remote command label Jul 27, 2021
@levy5307 levy5307 merged commit 6de2430 into XiaoMi:master Jul 28, 2021
@hycdong hycdong deleted the release_memory_all branch July 30, 2021 10:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/remote-command Add a remote command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants