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 5A4A318DE4 for ; Tue, 5 Jan 2016 13:07:40 +0000 (UTC) Received: (qmail 1937 invoked by uid 500); 5 Jan 2016 13:07:40 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 1886 invoked by uid 500); 5 Jan 2016 13:07:40 -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 1875 invoked by uid 99); 5 Jan 2016 13:07:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2016 13:07:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C53112C1F56 for ; Tue, 5 Jan 2016 13:07:39 +0000 (UTC) Date: Tue, 5 Jan 2016 13:07:39 +0000 (UTC) From: "Sergey Grebnov (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-8631) Memory leak in navigator.geolocation.getCurrentPosition on iOS 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-8631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15083021#comment-15083021 ] Sergey Grebnov commented on CB-8631: ------------------------------------ Robert, thank you for additional details, I'll test on iOS 8 later today and close it if there is no repro. > Memory leak in navigator.geolocation.getCurrentPosition on iOS > -------------------------------------------------------------- > > Key: CB-8631 > URL: https://issues.apache.org/jira/browse/CB-8631 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Geolocation > Affects Versions: 4.0.0 > Environment: Mac - Mavericks 10.9.5, Version 6.1.1 (6A2008a), Cordova 4.1.2. Also same behaviour on Mac Yosemite 10.10.2 , iOS Simulator 8.1, 7.1 and iOS phone 8.1 > Reporter: Robert Willett > Labels: geolocation, ios, memory-leak, triaged > Attachments: screenshot-memory-usage(no-repro).png > > > Calling navigator.geolocation.getCurrentPosition appears to leak memory, > A simple test case with all steps: > 1. cordova create geolocationtest com.example.geolocation GeoLocation > 2. cordova plugins add org.apache.cordova.console > 3. cordova plugin add org.apache.cordova.geolocation > 4. cordova platform add iOS > 5. Replace the www/js/index.js with the below below. This is basically the starter code and only two functions have been added, onSuccess and onFailure along with a timer call to navigator.geolocation.getCurrentPosition() > function onSuccess(position) { > console.log("Success..."); > } > function onFailure(error) { > console.log("Failed..."); > } > var app = { > // Application Constructor > initialize: function() { > this.bindEvents(); > }, > bindEvents: function() { > document.addEventListener('deviceready', this.onDeviceReady, false); > }, > onDeviceReady: function() { > app.receivedEvent('deviceready'); > setInterval(function () { > navigator.geolocation.getCurrentPosition(onSuccess , onFailure); > } , 1000); > }, > receivedEvent: function(id) { > var parentElement = document.getElementById(id); > var listeningElement = parentElement.querySelector('.listening'); > var receivedElement = parentElement.querySelector('.received'); > listeningElement.setAttribute('style', 'display:none;'); > receivedElement.setAttribute('style', 'display:block;'); > console.log('Received Event: ' + id); > } > }; > app.initialize(); > 6. cordova build ios > 7. Run the code in Xcode. The memory footprint keeps climbing as memory from the getCurrentPosition call does not appear to be released. > 8. Commenting out the console.log entries stills shows the memory footprint climbing around 200K per call to navigator.geolocation.getCurrentPosition(). > The navigator.geolocation.getCurrentPosition call appears to work correctly and reports the correct position. -- 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