Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEF2E1919B for ; Fri, 8 Apr 2016 23:40:25 +0000 (UTC) Received: (qmail 20619 invoked by uid 500); 8 Apr 2016 23:40:25 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 20579 invoked by uid 500); 8 Apr 2016 23:40:25 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 20530 invoked by uid 99); 8 Apr 2016 23:40:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2016 23:40:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7D3B62C1F5C for ; Fri, 8 Apr 2016 23:40:25 +0000 (UTC) Date: Fri, 8 Apr 2016 23:40:25 +0000 (UTC) From: "Nikhil Khandelwal (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-11034) Camera.getPicture -Handle of OutOfMemoryError gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-11034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nikhil Khandelwal updated CB-11034: ----------------------------------- Labels: Android mustfix triaged (was: Android) > Camera.getPicture -Handle of OutOfMemoryError gracefully > -------------------------------------------------------- > > Key: CB-11034 > URL: https://issues.apache.org/jira/browse/CB-11034 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Camera > Affects Versions: 2.1.1 > Environment: Android > Reporter: Dagfinn Parnas > Labels: Android, mustfix, triaged > > We have an app for which we are dependent on using DATA_URL. > On some older phones (Samsung SII Android 4.1), we have experienced sporadic OutOfMemoryError exceptions when taking a picture. > When this occurs the app crashes since the camera plugin doesn't explicitly handle the java.lang.OutOfMemoryError which is thrown. > It's ok that the OutOfMemoryError appear, but the apps should be able to handle it gracefully and not just have the app crash. > Example stack trace from an uncaught OutOfMemoryError > {code} > 04-06 09:51:55.155: E/dalvikvm-heap(22744): Out of memory on a 31961104-byte allocation. > 04-06 09:51:55.155: I/dalvikvm(22744): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) > 04-06 09:51:55.160: I/dalvikvm(22744): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:652) > 04-06 09:51:55.160: I/dalvikvm(22744): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:724) > 04-06 09:51:55.160: I/dalvikvm(22744): at org.apache.cordova.camera.CameraLauncher.getScaledBitmap(CameraLauncher.java:916) > 04-06 09:51:55.160: I/dalvikvm(22744): at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:454) > 04-06 09:51:55.160: I/dalvikvm(22744): at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:753) > 04-06 09:51:55.160: I/dalvikvm(22744): at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120) > {code} > In the example above, CameraLauncher.getScaledBitmap doesn't catch the java.lang.OutOfMemoryError and the app crashes. The same situation can occur in CameraLauncher.processPicture (which has a try catch with only exception) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org