[ 
https://issues.apache.org/jira/browse/CB-4004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695031#comment-13695031
 ] 

Ian Clelland commented on CB-4004:
----------------------------------

Some experimentation shows that there's a big issue with the 
{{String.fromCharCode}} call in the exec bridge:

{code}
String.fromCharCode.apply(null, new Uint8Array(args[i]))
{code}

is attempting to pass every byte of the input string as a separate argument to 
{{fromCharCode}}. Since the arguments array has to live on the stack frame, 
it's not surprising in afterthought that we have a problem there.

(Anecdotally, in chrome, I see an error in the javascript console after about 
125k arguments. That's probably highly sensitive to the environment, though)

I think your approach is right, to use a different method to go from 
ArrayBuffer to Base64-encoded string. I'll profile a couple of ways to do it, 
and report back any findings here.
                
> FileWriter fails to write large binary files
> --------------------------------------------
>
>                 Key: CB-4004
>                 URL: https://issues.apache.org/jira/browse/CB-4004
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>         Environment: Android (tested on Nexus 7, Android 4.2)
>            Reporter: Chris Barton
>            Assignee: Ian Clelland
>            Priority: Minor
>
> When attempting to write a file or blob (let's say a 5MB zip archive) to disk 
> via FileWriter#write, I receive a "RangeError, Maximum call stack size 
> exceeded" when trying to turn the ArrayBuffer into a Base64 string in #exec.

--
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

Reply via email to