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

Resizing terminal repeatedly causes a memory leak [BUG] #3087

Open
nuggreat opened this issue May 25, 2023 · 0 comments
Open

Resizing terminal repeatedly causes a memory leak [BUG] #3087

nuggreat opened this issue May 25, 2023 · 0 comments
Milestone

Comments

@nuggreat
Copy link

Repeated resizing of the kOS terminal appears to cause a memory leak while the resized terminal stays loaded. The terminal also doesn't need to be open for the leak to occur. The leak is also something interacting with the mono heap at least according to the basic performance information available in the alt+f12 menu. Lastly while I only tested going back to the tracking station the scene change did cause the memory to be released. Lastly the rate of the leak appears to be related to the amount of "area" change to the terminal as changing between an width of 200 and 201 showed more or less the same leak rate as changing between a width of 50 and 51, where as changing between a width of 25 and 50 would be faster, the height was held constant for my testing.

This was the code I used for testing

LOCAL width1 TO 50.
LOCAL width2 TO 200.

LOCAL oldTime TO KUNIVERSE:REALTIME.
LOCAL newTime TO oldTime.
UNTIL (newTime - oldTime) > 1 {
	SET TERMINAL:WIDTH TO CHOOSE width1 IF TERMINAL:WIDTH = width2 ELSE width2.
	SET oldTime TO newTime.
	SET newTime TO KUNIVERSE:REALTIME.
}

as at least on my system the leak was associated with significant lag so terminating the loop once the real time taken for a given pass grew to large meant I didn't need to restart KSP between each run.

This issue was originally posted on the kOS discord and it is being transferred so it isn't forgotten.

@JonnyOThan JonnyOThan added this to the 1.5.0.0 milestone Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants