Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8916

Huge memory consumption in iOS 8 with compass plugin when filter parameter is not specified

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Cordova iOS 3.7.0
      JQuery Mobile 1.3.2
      iOS 8

      Description

      Hi, I found a bug that occurs if the filter parameter is not specified. It triggers a large memory consumption in the app and ultimately the app will not respond to user input.

      My function tracks the direction for a list of places, and updates the heading in real time (one for each place). The code below is my function. When I tested my app(built against iOS 8 SDK) on both iOS(iPhone5 iOS8) emulator and iPhone 6(iOS 8.0.2), the memory consumption increased significantly when the function was called. The app failed to respond after about 1 minute 40 seconds, and the memory usage was around 270 mb(I was monitoring in XCode). The console log Compass Count indicates that the app usually dies when count reaches around 960.

      The issue occurs when the app is built against iOS SDK 8.1. However the same code runs fine in the app when it is built against iOS 7 SDK (there is no noticeable increase in memory consumption).

      Could you please look into this? Thanks

      function activateCompass(frequency, callback){

      var frequency = frequency || 100;
      console.log("frequency is " + frequency);

      var options =

      { frequency: frequency}

      ;
      compassHeading = navigator.compass.watchHeading(
      function compassSuccess(heading)

      { console.log('Compass Count: ' + compassCounter++); callback(heading.magneticHeading); }

      ,
      function compassError(compassError)

      { console.log('Compass error: ' + compassError.code + ' Counter is ' + compassCounter++); }

      ,
      options
      );

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kinszhang wei zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: