-
Notifications
You must be signed in to change notification settings - Fork 91
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
#648: switch to the regular toString for logging to prevent excessive memory usage #649
Conversation
Kudos, SonarCloud Quality Gate passed! |
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, thanks. Is the dump from above with or without #647?
@@ -83,7 +83,7 @@ public void persistHistory(PersistableInstallationLogger installLog) { | |||
|
|||
String mergedAndProcessedConfig = installLog.getMergedAndProcessedConfig(); | |||
if (StringUtils.isNotBlank(mergedAndProcessedConfig)) { | |||
JcrUtils.putFile(historyNode, "mergedConfig.yaml", "text/yaml", | |||
JcrUtils.putFile(historyNode, "mergedConfig.txt", "text/plain", |
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.
so this is a shame to have only a "toString" representation saved - isn't it possible to somehow generate the yaml without too much memory impact? (IIRC today snippets of this file can be used to test things and do some "round-tripping")
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.
suggestions welcome, SnakeYAML itself has huge overhead!
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.
I suppose we could fairly easily write a toString method, that creates valid yaml (instead of just using ToStringBuilder
) - but we can also do that separately, not the most important to have immediately
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.
Replace serialization of config from Yaml to regular toString.
Comparison of memory usage:
Before (OutOfMemory ons serialization)
After (no OutOfMemory)
Example of serialized config in the history