FokkeZB / nl.fokkezb.loading

The widget provides a simple loading mask that can be easily styled and configured.
93 stars 18 forks source link

OutOfMemoryError (on several Android devices) #43

Closed onury closed 6 years ago

onury commented 6 years ago

Usage / Case

Alloy.js

Alloy.Globals.loading = Alloy.createWidget("nl.fokkezb.loading");

someController.js

function fetchData(){
    Alloy.Globals.loading.show();
    return somePromise
        .then(function (){
            // do async stuff
        })
        .finally(function (){
            // finalize stuff
            Alloy.Globals.loading.hide();
        });
}

Error

...
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 108MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 6(144B) AllocSpace objects, 0(0B) LOS objects, 3% free, 92MB/96MB, paused 203us total 40.714ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 108MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 3% free, 92MB/96MB, paused 281us total 40.590ms
[INFO] :   art: Forcing collection of SoftReferences for 4MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 108MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 10(288B) AllocSpace objects, 0(0B) LOS objects, 3% free, 92MB/96MB, paused 311us total 45.109ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 4194316 byte allocation with 3574496 free bytes and 3MB until OOM"
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.esarj.mobile.EArjActivity@6997d78
[ERROR] :  EGL_emulation: tid 3936: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
[WARN] :   OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd19de360, error=EGL_BAD_MATCH
[WARN] :   art: No such thread id for suspend: 12

Resolution / Workaround

When ProgressIndicator is disabled, all Starting a blocking GC Alloc warnings and OutOfMemoryError crashes disappear (and I see it falls back to using ActivityIndicator, which works fine).

Alloy.Globals.loading = Alloy.createWidget("nl.fokkezb.loading", false);

So this is not an issue with nl.fokkezb.loading directly but still, a vendor-bug is a bug. FYI

Note: I'm not filing an issue with Appcelerator or Titanium JIRA because it's a waste of my time and they never look into it. There are lots of unresolved, several years old issues.. And frankly this is just one example to various memory leak problems of Titanium.

onury commented 6 years ago

Seems this widget is not really the cause. Disabled the widget but still happens (a bit less but still..) Closing this now.