You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Simon MacDonald (Created) (JIRA)" <ji...@apache.org> on 2011/11/29 04:27:39 UTC

[jira] [Created] (CB-76) PhoneGap Android JSAlerts may have a memory leak

PhoneGap Android JSAlerts may have a memory leak
------------------------------------------------

                 Key: CB-76
                 URL: https://issues.apache.org/jira/browse/CB-76
             Project: Apache Callback
          Issue Type: Bug
          Components: Android
            Reporter: Simon MacDonald


This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!

E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.

Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser updated CB-76:
-------------------------

    Fix Version/s:     (was: 2.0.0)
                   1.7.0
    
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 1.7.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13204022#comment-13204022 ] 

Joe Bowser commented on CB-76:
------------------------------

This should be fixed with CB-190, since we don't fire onNativeReady until the page is finished.  This will prevent this problem.
                
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 2.0.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser reopened CB-76:
--------------------------

    
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 1.7.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-76.
--------------------------

    Resolution: Won't Fix
    
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 1.7.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-76.
--------------------------

    Resolution: Fixed

This is where you use an alert in a Callback that takes longer to come back than the timeout on the loadUrl. If you have an Async call to Alert happen the same time as you close the app, this will happen, and I don't think there's an easy way to avoid it.
                
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 1.7.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-76) PhoneGap Android JSAlerts may have a memory leak

Posted by "Joe Bowser (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-76?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser updated CB-76:
-------------------------

    Fix Version/s: 2.0.0
         Assignee: Joe Bowser
    
> PhoneGap Android JSAlerts may have a memory leak
> ------------------------------------------------
>
>                 Key: CB-76
>                 URL: https://issues.apache.org/jira/browse/CB-76
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 2.0.0
>
>
> This was discovered on a client project, and is intermittent. I wrote it off as a device issue until I ran into the same issue today on a Nexus S running CyanogenMod. Here's the issue in question!
> E/WindowManager( 4255): android.view.WindowLeaked: Activity (removed for confidentiality) has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40586158 that was originally added here
> E/WindowManager( 4255):     at android.view.ViewRoot.<init>(ViewRoot.java:259)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
> E/WindowManager( 4255):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
> E/WindowManager( 4255):     at android.view.Window$LocalWindowManager.addView(Window.java:465)
> E/WindowManager( 4255):     at android.app.Dialog.show(Dialog.java:241)
> E/WindowManager( 4255):     at android.app.AlertDialog$Builder.show(AlertDialog.java:812)
> E/WindowManager( 4255):     at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:824)
> E/WindowManager( 4255):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:501)
> E/WindowManager( 4255):     at android.os.Handler.dispatchMessage(Handler.java:99)
> E/WindowManager( 4255):     at android.os.Looper.loop(Looper.java:130)
> E/WindowManager( 4255):     at android.app.ActivityThread.main(ActivityThread.java:3835)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 4255):     at java.lang.reflect.Method.invoke(Method.java:507)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
> E/WindowManager( 4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
> E/WindowManager( 4255):     at dalvik.system.NativeStart.main(Native Method)
> This happens when people are using an Alert in a callback, in this case the reachability API. I'm going to investigate this further, but its the reason there's the infamous "The connection to the server was unsuccessful" is happening.
> Of course, once you kill it and restart the app, the problem goes away, but this doesn't provide a great user experience. I'll assign this to myself.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira