-
Enhancement
-
Resolution: Done
-
Major
-
2.3.6.Final, 3.0-beta-5
-
None
Upload of a several MB file to a PUT service results in a very slow creation of a temporary file.
Produced by code below:
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import javax.ws.rs.Consumes; import javax.ws.rs.PUT; import javax.ws.rs.Path; import org.jboss.resteasy.client.ProxyFactory; import org.junit.Test; public class DummyTest { @Path("/dummy") interface DummyService { @PUT @Consumes("*/*") String process( InputStream data ); } @Test public void test() throws FileNotFoundException { DummyService service = ProxyFactory.create( DummyService.class, "http://nonexistent.domain/rest/" ); service.process( new FileInputStream( "<path to a large file>" ) ); } }
Result is 100% CPU load for several minutes while building a temporary file, followed by an UnknownHostException, as expected.
Tested on Windows XP sp 3 with RESTEasy 2.3.5 and JRE 1.6.0_27.