Skip to content
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 Python logging memory leak #3050

Merged
merged 1 commit into from Jun 16, 2020

Conversation

Morlic-fo
Copy link
Contributor

@Morlic-fo Morlic-fo commented Jun 15, 2020

The stringstream buffer was never cleared and eventually contained the entire log.

Note that this memory leak was recently amplified by malformed logs (see #3049) but already present in older versions. @Vezzra: This should subsequently be cherry-picked into release.

Resolves #3038

The stringstream buffer was never cleared and eventually contained the entire log.
@Morlic-fo Morlic-fo added category:bug The Issue/PR describes or solves a perceived malfunction within the game. component:internal The Issue/PR deals with any project component that has no explicit `component` label. labels Jun 15, 2020
@Morlic-fo Morlic-fo added this to the v0.4.10 milestone Jun 15, 2020
@Morlic-fo Morlic-fo added the status:cherry-pick for release The PR should be applied to the currently open release branch. label Jun 15, 2020
@geoffthemedio
Copy link
Member

The stringstream buffer was never cleared

There are ss.clear() right after your added lines, so I'm confused by the description and the fix...

@Cjkjvfnby
Copy link
Contributor

There are ss.clear() right after your added lines, so I'm confused by the description and the fix...

Confusing names are meant to confuse.
http://www.cplusplus.com/reference/ios/ios/clear/

@geoffthemedio geoffthemedio merged commit 964d7a8 into freeorion:master Jun 16, 2020
@geoffthemedio geoffthemedio added the status:merged All relevant commits of this PR were merged into the master development branch. label Jun 16, 2020
@Morlic-fo Morlic-fo deleted the FixAIMemoryLeak branch June 16, 2020 06:46
@Vezzra Vezzra removed the status:cherry-pick for release The PR should be applied to the currently open release branch. label Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug The Issue/PR describes or solves a perceived malfunction within the game. component:internal The Issue/PR deals with any project component that has no explicit `component` label. status:merged All relevant commits of this PR were merged into the master development branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI High Memory Usage
4 participants