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

Make frequently used IO resources autoclosable #8181

Merged
merged 7 commits into from
Jan 11, 2021

Conversation

agilob
Copy link
Contributor

@agilob agilob commented Dec 14, 2020

to reduce memory use and unlock them for use by operating system resource scheduler/allocator

Below you can see I run the same template manager test which opens and reads IO resources. I added extra line on debugger just to keep resources busy a bit longer for lsof to scan though them, this allows me to compare before/after results of my changes, as it would be much more difficult to automate this test inside maven, it's all manual.

List of files open by Linux checked with

lsof -f | grep '/home/agilob/Projects/openapi-generator/'

Before changes:
without change

Same test after changes:
working example

Also reduced complexity of reading dart specific keywords from external file.
Autoclose input reader from ruby error stream

I do not know what the kotlin changes are, I promise ¯_(ツ)_/¯

Closes #1909 and fixes a few other unreported

@kuhnroyal
Copy link
Contributor

Hmm the Kotlin changes also break my PR :(

@agilob
Copy link
Contributor Author

agilob commented Dec 14, 2020

Yea, something untested got merged to master, dont worry about it.

@wing328
Copy link
Member

wing328 commented Dec 15, 2020

cc @OpenAPITools/generator-core-team

@wing328
Copy link
Member

wing328 commented Dec 15, 2020

The kotlin samples have been updated in the master. Please merge the latest master into this branch when you've time.

@agilob
Copy link
Contributor Author

agilob commented Dec 15, 2020

@wing328 done!

@agilob
Copy link
Contributor Author

agilob commented Dec 23, 2020

@OpenAPITools/generator-core-team @wing328

@agilob
Copy link
Contributor Author

agilob commented Jan 7, 2021

@wing328 @jimschubert any plans to merge it?

@wing328
Copy link
Member

wing328 commented Jan 8, 2021

Let me try to review over the weekend.

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and the result is good.

@wing328 wing328 merged commit ed9133e into OpenAPITools:master Jan 11, 2021
@agilob
Copy link
Contributor Author

agilob commented Jan 11, 2021

Thanks

@agilob agilob deleted the auto-closable-IO-resources branch September 9, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants