maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lott (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WAGON-518) AbstractHttpClientWagon#putFromStream reads entire content to memory
Date Thu, 19 Apr 2018 16:02:00 GMT

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

Chris Lott updated WAGON-518:
-----------------------------
    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:
{code:java}
     byte[] bytes = IOUtil.toByteArray( stream );{code}
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. 

  was:
Method putFromSteam in class AbstractHttpClientWagon consumes much memory because it first
consumes the input stream argument, THEN transfers what it read.  The code that consumes
the stream is in the private class RequestEntityImplementation ctor:
{code:java}
     byte[] bytes = IOUtil.toByteArray( stream );{code}
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. 


> AbstractHttpClientWagon#putFromStream reads entire content to memory
> --------------------------------------------------------------------
>
>                 Key: WAGON-518
>                 URL: https://issues.apache.org/jira/browse/WAGON-518
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-http
>    Affects Versions: 2.12
>            Reporter: Chris Lott
>            Priority: Major
>
> 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:
> {code:java}
>      byte[] bytes = IOUtil.toByteArray( stream );{code}
> 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. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message