[
https://issues.apache.org/jira/browse/WICKET-5745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14193154#comment-14193154
]
Uffe Heerfordt commented on WICKET-5745:
----------------------------------------
Hi,
Yes, fair enough it's a minor issue.
I have attached a before & after picture from the yourkit profiler that shows
the markup file leak.
Br,
Uffe.
> Markupfile inputstream not being closed
> ---------------------------------------
>
> Key: WICKET-5745
> URL: https://issues.apache.org/jira/browse/WICKET-5745
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.17.0
> Environment: dev
> Reporter: Uffe Heerfordt
> Priority: Minor
> Labels: easyfix
> Attachments: afterexplitctclosefromprofiler.jpg, fromprofiler.jpg
>
> Original Estimate: 10m
> Remaining Estimate: 10m
>
> Hi,
> I was investigating a problem today with a profiler and was inform that a
> potentiel issue existed with fileinputstreams that wasen't being closed. I
> could that it was my wicket markup files that was never being closed.
> The problem seems to be located here:
> org.apache.wicket.markup.AbstractMarkupParser
> method: parse();
> Should'nt there be an explict call to close the MarkupResourceStream after
> parsning the markup after line 183.
> Something like:
> // Initialize the xml parser
> MarkupResourceStream markupResourceStream =
> markup.getMarkupResourceStream();
> try{
>
> xmlParser.parse(markupResourceStream.getResource().getInputStream(),
> markupSettings.getDefaultMarkupEncoding());
>
> // parse the xml markup and tokenize it into wicket
> relevant markup
> // elements
> parseMarkup();
> }
> finally{
> markupResourceStream.close();
> }
> Br,
> Uffe.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)