-
Notifications
You must be signed in to change notification settings - Fork 43
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
Plug a memory leaks on every reload #91
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The resources must be freed during shutdown process when fluentd graceful reload is executed. Without it, fluentd --under-supervisor process keeps to consume memory. Before: Every fluentd is reloaded, the value of RES increases. % while true; do top -b -n 1|\grep ruby;sleep 1;done 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.52 ruby 126506 kenhys 20 0 1247164 82512 47536 S 0.0 0.3 0:00.48 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.52 ruby 126506 kenhys 20 0 1247324 82776 47536 S 0.0 0.3 0:00.49 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.52 ruby 126506 kenhys 20 0 1777844 99824 64484 S 0.0 0.3 0:00.49 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.52 ruby 126506 kenhys 20 0 1777844 99824 64484 S 0.0 0.3 0:00.49 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.53 ruby 126506 kenhys 20 0 1777976 100072 64484 S 0.0 0.3 0:00.50 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.53 ruby 126506 kenhys 20 0 2308496 119016 83348 S 0.0 0.4 0:00.51 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.54 ruby 126506 kenhys 20 0 2308496 119016 83348 S 0.0 0.4 0:00.52 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.54 ruby 126506 kenhys 20 0 2839016 138284 102556 S 0.0 0.4 0:00.52 ruby 126501 kenhys 20 0 193052 46452 11004 S 0.0 0.1 0:00.54 ruby 126506 kenhys 20 0 2839016 138284 102556 S 0.0 0.4 0:00.52 ruby 126501 kenhys 20 0 193052 46664 11068 S 0.0 0.1 0:00.55 ruby 126506 kenhys 20 0 2839016 138356 102620 S 0.0 0.4 0:00.52 ruby 126501 kenhys 20 0 193052 46664 11068 S 0.0 0.1 0:00.55 ruby 126506 kenhys 20 0 3369536 155020 119256 S 0.0 0.5 0:00.53 ruby 126501 kenhys 20 0 193052 46664 11068 S 0.0 0.1 0:00.55 ruby 126506 kenhys 20 0 3369536 155020 119256 S 0.0 0.5 0:00.54 ruby 126501 kenhys 20 0 193052 46664 11068 S 6.7 0.1 0:00.56 ruby 126506 kenhys 20 0 3900056 173852 138016 S 0.0 0.5 0:00.54 ruby 126501 kenhys 20 0 193052 46664 11068 S 0.0 0.1 0:00.57 ruby 126506 kenhys 20 0 3900056 173852 138016 S 0.0 0.5 0:00.54 ruby 126501 kenhys 20 0 193052 46664 11068 S 0.0 0.1 0:00.57 ruby 126506 kenhys 20 0 4430576 193100 157192 S 0.0 0.6 0:00.54 ruby 126501 kenhys 20 0 193052 46780 11068 S 0.0 0.1 0:00.57 ruby 126506 kenhys 20 0 4430576 193104 157192 S 0.0 0.6 0:00.54 ruby 126501 kenhys 20 0 193052 46780 11068 S 0.0 0.1 0:00.57 ruby 126506 kenhys 20 0 4430576 193152 157192 S 0.0 0.6 0:00.54 ruby After: Even though fluentd is reloaded, the value of RES does not increase. % while true; do top -b -n 1|\grep ruby;sleep 1;done 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.59 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.59 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.59 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 186860 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 712276 62804 28196 S 0.0 0.2 0:00.59 ruby 117844 kenhys 20 0 193016 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 186144 45892 11244 S 0.0 0.1 0:00.60 ruby 117844 kenhys 20 0 193016 46308 10848 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 716664 63160 28372 S 0.0 0.2 0:00.60 ruby 117844 kenhys 20 0 193016 46388 10912 S 0.0 0.1 0:00.60 ruby 117858 kenhys 20 0 716664 63216 28436 S 0.0 0.2 0:00.60 ruby Signed-off-by: Kentaro Hayashi <[email protected]>
@errm Could you kindly take a look? |
@errm ping |
errm
approved these changes
May 28, 2021
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
I will fix up the rubocop issues before cuting a release!
Thanks! |
Thanks for the fix @kenhys I just pushed 1.0.5 to rubygems |
Thanks! |
george-angel
added a commit
to utilitywarehouse/fluentd
that referenced
this pull request
Jun 11, 2021
- remove ES plugin gem, not used - update system plugin, fixes a leak: fluent-plugins-nursery/fluent-plugin-systemd#91
george-angel
added a commit
to utilitywarehouse/fluentd
that referenced
this pull request
Jun 11, 2021
- remove ES plugin gem, not used - update system plugin, fixes a leak: fluent-plugins-nursery/fluent-plugin-systemd#91 - update kubernetes_metadata_filter, that is compatible with fluentd 1.13
kenhys
added a commit
to kenhys/fluentd-kubernetes-daemonset
that referenced
this pull request
Jul 15, 2021
See fluent-plugins-nursery/fluent-plugin-systemd#91 TODO: make src-all when it is ready for newer release Signed-off-by: Kentaro Hayashi <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The resources must be freed during shutdown process when fluentd
graceful reload is executed. Without it, fluentd --under-supervisor
process keeps to consume memory.
Reproducible steps:
http://127.0.0.1:24444/api/config.gracefulReload
few times. less than 10 times is enough.FYI: fluent/fluentd#3342
Before:
Every fluentd is reloaded, the value of top (RES) increases.
After:
Even though fluentd is reloaded, the value of RES does not increase.