cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Hansen (JIRA)" <>
Subject [jira] [Commented] (CB-8002) Creating a new div for every Js -> Native exec() call
Date Fri, 06 Feb 2015 16:20:36 GMT


Kim Hansen commented on CB-8002:

Putting in a plug for getting this fix out sooner than later. The memory growth doesn't trigger
iOS memory warnings so a dev may be unaware it's happening. It does not appear as a leak in
Instruments, but that's expected since it's not really a leak. In our app, it seems like the
OS puts us in bad-app jail and queues up native calls. 

Symptomatically, Xcode console output stops and calls through the dialogs plugin don't result
in a dialog presentation--nothing at all happens. Non system events proceed normally so until
there's a failed system level call a user will think the app is ok. As soon as the home button
is pressed, Xcode console will barf out all of the queued console.log messages and when the
app is relaunched (without force quit), the queued dialogs appear. All of them, one at a time.

For the benefit of google, Instruments shows unabated growth of the memory allocated to VM:
JS garbage collector. My simple test method is to use setInterval to fire off a console.log
message indicating the current time, and then watch the console either in Xcode itself or
via the devices window in Xcode. At some point in time with 3.7.0, the console messages will
stop arriving.

I have tested the fix on the following devices, watching both for the above symptoms and for
the linear memory usage expansion signature (we make routine system calls in our app) in both
Instruments and Xcode. I am satisfied (enough) that the fix is production worthy, we'll be
shipping to Apple later today.
 * iPhone 4S on 7.0.6
 * iPhone 5, 5S and 6 on 8.1.3

> Creating a new div for every Js -> Native exec() call
> -----------------------------------------------------
>                 Key: CB-8002
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.7.0
>         Environment: Tested on multiple iOS 8.1 devices, simulators
>            Reporter: Serdar Onal
>            Assignee: Andrew Grieve
>            Priority: Critical
>             Fix For: 3.8.0
> Since the 3.7.0 update, when cordova does a Js to Native call using exec(), somehow the
underlying cordova.js is creating a "gap://ready" iframe on every call. This means that if
you made 1000 native calls you'll have 1000 divs on the DOM.
> I believe this issue is of critical priority as it incurs a huge memory leak.
> Screenshot from safari inspector

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message