JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6611

LoadServiceResource Opens But Never Closes InputStreams When Constructed With a URL

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The line in question - https://github.com/jruby/jruby/blob/master/src/org/jruby/runtime/load/LoadServiceResource.java#L80

      The getInputStream method of LoadServiceResource, only when constructed with a URL, leaks via a call to resource.openStream().

      Because LoadServiceInputStream completely buffers the contents of the InputStream passed to it, you can close the InputStream created from resource.openStream() after constructing the new LoadServiceInputStream. There may be a better solution, but we've been using this workaround in a custom NonLeakingLoadServiceResource in TorqueBox for several months and it seems to work fine.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Ben Browning
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: