-
Notifications
You must be signed in to change notification settings - Fork 80
Use a thread local StringBuilder to avoid creating garbage #83
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
Conversation
❕ Build Aborted
Expand to view the summary
Build stats
Trends 🧪Steps errors
Expand to view the steps failures
|
|
Can anyone please have a look at this? |
|
Sorry, I thought I had answered already. I'm not sure this makes a lot of difference. There are still allocations when calling |
|
Yes, there we are still allocating "garbage", but not as much as before. |
|
The thing is that caching that StringBuilder thread-locally does add memory overhead to each thread that performs logging. By using Logback, you basically have already agreed to use a logging library that does create garbage. If you want a zero-garbage alternative, why not use log4j2? This hybrid approach might just combine the downsides of both - higher memory footprint and still creating garbage. |
|
Sorry for the long delay. I want to use it in Wildfly/JBoss EAP. I did not do any performance testing, but I don't think my change will negatively affect my use case. |
|
@tobiasstadler can we close this one? |
|
yes |
|
Thanks 🙏 |
No description provided.