You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Anli Shundi (JIRA)" <ji...@apache.org> on 2013/01/14 19:28:13 UTC
[jira] [Commented] (SANTUARIO-351) Remove ThreadLocal storage from
OutputStreams
[ https://issues.apache.org/jira/browse/SANTUARIO-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13552958#comment-13552958 ]
Anli Shundi commented on SANTUARIO-351:
---------------------------------------
The problem is the remove statement in .close() method.
The value of ThreadLocal is to reuse the buffer; it ensures that it's used only by one thread at a time.
The right fix would be to delete line 98 at http://svn.apache.org/viewvc/santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java?view=markup
You'll pay some memory penalty for the benefit of allocating memory faster...
> Remove ThreadLocal storage from OutputStreams
> ---------------------------------------------
>
> Key: SANTUARIO-351
> URL: https://issues.apache.org/jira/browse/SANTUARIO-351
> Project: Santuario
> Issue Type: Bug
> Components: Java
> Affects Versions: Java 1.5.3
> Reporter: Colm O hEigeartaigh
> Assignee: Colm O hEigeartaigh
> Fix For: Java 1.5.4, Java 2.0.0
>
>
> This task is to remove ThreadLocal storage from the UnsyncBufferedOutputStream and UnsyncByteArrayOutputStream, and just use new byte[X] instead. There seems little benefit to ThreadLocals here, particularly as the local byte[] is being removed on close anyway. See here for a downstream problem on Glassfish:
> https://issues.apache.org/jira/browse/WSS-419
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira