Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-518

AbstractHttpClientWagon#putFromStream() reads entire content to memory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12
    • Fix Version/s: 3.1.0
    • Component/s: wagon-http
    • Labels:
      None

      Description

      Method putFromSteam in class AbstractHttpClientWagon seems to violate the implied contract of working with streams.  It uses much memory because it first consumes the input stream argument, then transfers that content.  The code that consumes the stream is in the private class RequestEntityImplementation ctor:

           byte[] bytes = IOUtil.toByteArray( stream );

      Please revise it, if possible, to behave more like the superclass StreamWagon's putFromStream method, which does the transfer straight from the input stream.

      We are attempting to PUT some 150MB artifacts in a java microservice that runs with rather sharp memory limits.  As a local workaround we increased the JVM's -Xmx argument but that way lies madness.

      Thanks in advance for any suggestions or workarounds. 

        Attachments

          Activity

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              chrislott Chris Lott
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: