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

Robert Willett edited comment on CB-8631 at 1/5/16 11:16 AM:
-------------------------------------------------------------

Sergey,

We stopped using this function as the memory leak was too high. However this 
was done on Xcode 6.x (6.4 probably),  ios 8.something and older versions of 
the rest of the Cordova base. I know a few other people have reported the same 
issue as well (not just on this tracker), so I know it wasn't just me :)

>From your tests the memory leak no longer occurs under more recent versions 
>which is great.

Thanks for testing and I suggest we close the bug report.

Rob


was (Author: rwillett):
Sergey,

We stopped using this function as the memory leak was too high. However this 
was done on Xcode 6.x (6.4 probably),  ios 8.something and significantly older 
versions of the rest of the Cordova base. I know a few other people have 
reported the same issue as well (not just on this tracker), so I know it wasn't 
just me :)

>From your tests the memory leak no longer occurs under more recent versions 
>which is great.

Thanks for testing and I suggest we close the bug report.

Rob

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to