You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Xiaoming Shi (JIRA)" <ji...@apache.org> on 2011/03/13 03:27:59 UTC

[jira] Created: (OPENEJB-1444) Copying data from inputStream to OuputStream needs appropriate buffer size

Copying data from inputStream to OuputStream needs appropriate buffer size
--------------------------------------------------------------------------

                 Key: OPENEJB-1444
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1444
             Project: OpenEJB
          Issue Type: Bug
          Components: container system
    Affects Versions: 3.1.4
            Reporter: Xiaoming Shi


In the file:

./openejb-3.1.4-src/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java line:149

It uses a fixed buffer size as 4096.

To copy 10M data with 1024-byte buffer it takes 338,591,180 nano-second, while it takes 105,384,689 nano-second with a 10240-byte buffer.

This is similar to the Apache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=32546


Similar code can be found in the files:
./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/JarExtractor.java
./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/JuliLogStreamFactory.java
./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java
./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/Pipe.java
./openejb-3.1.4-src/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OPENEJB-1444) Copying data from inputStream to OuputStream needs appropriate buffer size

Posted by "David Blevins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419700#comment-13419700 ] 

David Blevins commented on OPENEJB-1444:
----------------------------------------

Also noted in OPENEJB-1434 and OPENEJB-1436 to affect:

 ./openejb-3.1.4-src/server/openejb-webadmin/src/main/java/org/apache/openejb/webadmin/httpd/HttpResponseImpl.java line : 332 
                
> Copying data from inputStream to OuputStream needs appropriate buffer size
> --------------------------------------------------------------------------
>
>                 Key: OPENEJB-1444
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1444
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: container system
>    Affects Versions: 3.1.4
>            Reporter: Xiaoming Shi
>
> In the file:
> ./openejb-3.1.4-src/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java line:149
> It uses a fixed buffer size as 4096.
> To copy 10M data with 1024-byte buffer it takes 338,591,180 nano-second, while it takes 105,384,689 nano-second with a 10240-byte buffer.
> This is similar to the Apache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=32546
> Similar code can be found in the files:
> ./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/JarExtractor.java
> ./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/JuliLogStreamFactory.java
> ./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jLogStreamFactory.java
> ./openejb-3.1.4-src/container/openejb-core/src/main/java/org/apache/openejb/util/Pipe.java
> ./openejb-3.1.4-src/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira