You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Andreas Beeker (Jira)" <ji...@apache.org> on 2021/06/22 22:39:01 UTC

[jira] [Resolved] (XMLBEANS-481) Base64 to byte[] is not very efficient

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

Andreas Beeker resolved XMLBEANS-481.
-------------------------------------
    Fix Version/s: Version 5.0.1
         Assignee: Andreas Beeker
       Resolution: Fixed

Thanks for bringing this up.

Fixed via [r1890981|https://svn.apache.org/viewvc?view=revision&revision=1890981]

> Base64 to byte[] is not very efficient
> --------------------------------------
>
>                 Key: XMLBEANS-481
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-481
>             Project: XMLBeans
>          Issue Type: Improvement
>          Components: DOM
>    Affects Versions: Version 2.5
>            Reporter: Matej Spiller-Muys
>            Assignee: Andreas Beeker
>            Priority: Major
>             Fix For: Version 5.0.1
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> We are using 30 mb large byte[] string represented as base64 binary type in shema and it is causing out of memory for us on server. Basically converting from base64 string to byte[] is not very efficient.
> JavaBase64Holder.java is using: vBytes = v.getBytes("UTF-8") and according to http://www.evanjones.ca/software/java-string-encoding-internals.html it uses base64 size * 4. In our case where there is 30mb large byte[] it uses around 160 mb just for converting string into byte[].
> Would it be possible to use v.getBytes("ASCII")? This would reduce the memory usage when converting from string to byte[] by 4 times.
> According to http://www.w3.org/TR/xmlschema-2/#base64Binary it should use only ASCII chars anyway.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org