Uh oh!
There was an error while loading. Please reload this page.
Make all loggers non-static - #8799
Merged
Merged
Conversation
agilobforce-pushed
the
make-loggers-non-static
branch
from
February 22, 2021 17:39
67654f2 to
247dfdaCompareReduces memory usage on startup by between 2 and 4 MB
wing328
approved these changes
Feb 23, 2021
thobed added a commit
to thobed/openapi-generator
that referenced
this pull request
Mar 14, 2026
The project enforces that Logger fields must not be static to avoid unnecessary memory consumption, since generators are used once per program lifetime (see PR OpenAPITools#8799).
bold84 added a commit
to bold84/openapi-generator
that referenced
this pull request
Aug 26, 2026
… rule ArchUnitRulesTest requires slf4j Logger fields to be non-public, non-static and final (PR OpenAPITools#8799); the new assembler logger was static. Both call sites are instance methods, so the field becomes an instance logger.
This file contains hidden or 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
Sign up for freeto 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.
Wast majority of these
LOGGERs will never be used in the generator, but all of them will be initialized on JVM startup. Making them non-static reduces average JVM memory usage by between 2MB and 4MB when runningDartModelTest.simpleModelTestBefore:
After:
@wing328@jimschubert