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

[ui/Charts] Explicitly close the image output-stream, using a try-with-resources #4380

Conversation

Projects
None yet
3 participants
@martinvw
Copy link
Contributor

commented Oct 5, 2017

Folloing the openHAB community topic:

https://community.openhab.org/t/java-io-ioexception-too-many-open-files/28204/10?u=martinvw

The current implementation is depending on:

This class provide means to properly close hanging
image input/output streams on VM shutdown.
This might be useful for proper cleanup such as removal
of temporary files.

Source: https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/imageio/stream/StreamCloser.java#L34

The complete stack looks like
ChartServlet.java:280
ImageIO.java:1572
ImageIO.java:419
OutputStreamImageOutputStreamSpi.java:68
FileCacheImageOutputStream.java:95

Explicitly close the image output-stream, using a try-with-resources
Signed-off-by: Martin van Wingerden <martinvw@mtin.nl>
@openhab-bot

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2017

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/java-io-ioexception-too-many-open-files/28204/16

@martinvw

This comment has been minimized.

Copy link
Contributor Author

commented Oct 5, 2017

See also this really old bug report which inspired me to solve it like this:

http://bugs.java.com/view_bug.do?bug_id=4894964

@kaikreuzer kaikreuzer added the UI label Oct 5, 2017

@kaikreuzer
Copy link
Member

left a comment

Excellent, thanks!

@kaikreuzer kaikreuzer merged commit 002bd4f into eclipse:master Oct 6, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
ip-validation
Details

@martinvw martinvw deleted the martinvw:feature/explicitly-close-image-output-stream branch Oct 6, 2017

@openhab-bot

This comment has been minimized.

Copy link
Contributor

commented Nov 16, 2017

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/static-conf-html-keeps-files-open/35788/6

@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 30, 2017

@kaikreuzer kaikreuzer added the bug label Dec 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.