Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB4A218A9C for ; Tue, 8 Mar 2016 21:35:08 +0000 (UTC) Received: (qmail 66943 invoked by uid 500); 8 Mar 2016 21:35:08 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 66900 invoked by uid 500); 8 Mar 2016 21:35:08 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 66887 invoked by uid 99); 8 Mar 2016 21:35:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2016 21:35:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3BAD1DFA26; Tue, 8 Mar 2016 21:35:08 +0000 (UTC) From: jasongin To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org Message-ID: Subject: [GitHub] cordova-plugin-file pull request: CB-7862: FileReader reads large ... Content-Type: text/plain Date: Tue, 8 Mar 2016 21:35:08 +0000 (UTC) GitHub user jasongin opened a pull request: https://github.com/apache/cordova-plugin-file/pull/168 CB-7862: FileReader reads large files in chunks with progress I added support in FileReader for reading large files in chunks and reporting progress for each chunk. Previously, the Cordova FileReader would always read files as a single chunk (resulting in OOM exceptions for files > 10 MB or so), and would NEVER invoke the onprogress callback. With this change, it's possible to read files with sizes up to the actual available application memory: I have verified with files over 500 MB. The default chunk size of 256 KB is based on some non-scientific timing tests I did: it yields only minor overhead from multiple exec() calls while still providing frequent-enough progress reports for large files. Much smaller chunk sizes could cause large file reads to take significantly longer due to the numerous exec() calls (and progress callbacks). The FileReader.READ_CHUNK_SIZE value is exposed and may be adjusted by app code, though I don't expect that is something that would need to be changed normally so I didn't add it to the plugin documentation. The added test case however does use that capability so that it can verify chunking and progress behavior without having to generate a very large file. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jasongin/cordova-plugin-file CB-7862 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-file/pull/168.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #168 ---- commit 30f4a8810586dd048e17311f991a9b29315e7fde Author: Jason Ginchereau Date: 2016-03-08T21:11:21Z CB-7862: FileReader reads large files in chunks with progress ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org