-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix] [cli] Fix Broker crashed by too much memory usage of pulsar tools #20031
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
[fix] [cli] Fix Broker crashed by too much memory usage of pulsar tools #20031
Conversation
conf/pulsar_tools_env.sh
Outdated
| # Discard parameter "-Xms" of $PULSAR_MEM, which tends to be the Broker's minimum memory, to avoid using too much | ||
| # memory by tools. | ||
| if [ -n "$PULSAR_MEM" ]; then | ||
| PULSAR_MEM_REWRITE="-Xmx128m -XX:MaxDirectMemorySize=128m" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shell seems to set PULSAR_MEM to -Xmx128m -XX:MaxDirectMemorySize=128m?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If PULSAR_MEM exists, -Xmx and -XX:MaxDirectMemorySize will be overridden to 128m, and other options in PULSAR_MEM will not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just remove the -Xms, -Xmx and -XX:MaxDirectMemorySize don't need overriding to 128m
f95c66a to
eb60a33
Compare
coderzc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
eb60a33 to
20715ec
Compare
|
rebase master |
f57f10e to
20715ec
Compare
…ls (#20031) ### Motivation After #15868, we allow `PULSAR_MEM` & `PULSAR_GC` to be overridden in `pulsar_tool_env.sh`. Many users set `-Xms` to `2G` or larger in `PULSAR_MEM`, this will make the tools(such as `pulsar-admin`) cost a lot of memory, and if users execute `pulsar-admin` or another tool on the machine where the Broker is deployed, the current device will not have enough memory to allocate, resulting in a broker crash. ### Modifications When `PULSAR_MEM` is overridden in `pulsar_tool_env.sh`, delete parameter `-Xms` (cherry picked from commit 4f503fd)
…ls (#20031) ### Motivation After #15868, we allow `PULSAR_MEM` & `PULSAR_GC` to be overridden in `pulsar_tool_env.sh`. Many users set `-Xms` to `2G` or larger in `PULSAR_MEM`, this will make the tools(such as `pulsar-admin`) cost a lot of memory, and if users execute `pulsar-admin` or another tool on the machine where the Broker is deployed, the current device will not have enough memory to allocate, resulting in a broker crash. ### Modifications When `PULSAR_MEM` is overridden in `pulsar_tool_env.sh`, delete parameter `-Xms` (cherry picked from commit 4f503fd)
…ls (apache#20031) ### Motivation After apache#15868, we allow `PULSAR_MEM` & `PULSAR_GC` to be overridden in `pulsar_tool_env.sh`. Many users set `-Xms` to `2G` or larger in `PULSAR_MEM`, this will make the tools(such as `pulsar-admin`) cost a lot of memory, and if users execute `pulsar-admin` or another tool on the machine where the Broker is deployed, the current device will not have enough memory to allocate, resulting in a broker crash. ### Modifications When `PULSAR_MEM` is overridden in `pulsar_tool_env.sh`, delete parameter `-Xms` (cherry picked from commit 4f503fd) (cherry picked from commit 1fe05d5)
Motivation
After #15868, we allow
PULSAR_MEM&PULSAR_GCto be overridden inpulsar_tool_env.sh.Many users set
-Xmsto2Gor larger inPULSAR_MEM, this will make the tools(such aspulsar-admin) cost a lot of memory, and if users executepulsar-adminor another tool on the machine where the Broker is deployed, the current device will not have enough memory to allocate, resulting in a broker crash.Modifications
When
PULSAR_MEMis overridden inpulsar_tool_env.sh, delete parameter-XmsDocumentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: