[jira] [Updated] (BATIK-1143) SAXSVGDocumentFactory.createDocument(String uri) opens an input stream but doesn't close it

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Updated] (BATIK-1143) SAXSVGDocumentFactory.createDocument(String uri) opens an input stream but doesn't close it

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/BATIK-1143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Gouesse updated BATIK-1143:
----------------------------------
    Priority: Major  (was: Critical)

> SAXSVGDocumentFactory.createDocument(String uri) opens an input stream but doesn't close it
> -------------------------------------------------------------------------------------------
>
>                 Key: BATIK-1143
>                 URL: https://issues.apache.org/jira/browse/BATIK-1143
>             Project: Batik
>          Issue Type: Bug
>          Components: SVG DOM
>    Affects Versions: 1.7, 1.8, 1.6.1, 1.7.1
>            Reporter: Julien Gouesse
>              Labels: easyfix, performance
>
> Batik opens an input stream here:
> https://github.com/apache/batik/blob/trunk/batik-anim/src/main/java/org/apache/batik/anim/dom/SAXSVGDocumentFactory.java#L158
> This opened stream is no longer useful after the creation of the SVGOMDocument instance, it could get closed somewhere, typically here:
> https://github.com/apache/batik/blob/trunk/batik-anim/src/main/java/org/apache/batik/anim/dom/SAXSVGDocumentFactory.java#L208
> I would use a try-with-resource or at least a try finally block to do so. This is what I do as a temporary workaround, I override this method in my source code and it works.
> As far as I know, SAXSVGDocumentFactory.createDocument(String uri) doesn't open streams that don't need to be closed (see ByteArrayInputStream). Leaving such streams open can lead to memory leaks and to run out of native resources (file handles, connections, ...).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...