Skip to first unread message

Boom

unread,
Nov 20, 2015, 12:37:32 PM11/20/15
to MIT App Inventor Forum
Hello ,  occurring errors in my app and I do not understand why. Often occur on the Samsung Galaxy S6 Edge and Notes 4 , but the application crashes often in other systems .. can you help? When I try to open other screens the application exits abnormally
This 
java.lang.OutOfMemoryError: Failed to allocate a 16777228 byte allocation with 2793124 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:942)
at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
at android.graphics.Bitmap.createBitmap(Bitmap.java:844)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:720)
at com.google.appinventor.components.runtime.util.MediaUtil.getBitmapDrawable(MediaUtil.java:350)
at com.google.appinventor.components.runtime.ButtonBase.Image(ButtonBase.java:318)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at gnu.expr.PrimProcedure.apply(PrimProcedure.java:285)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
at gnu.mapping.CallContext.runUntilValue(CallContext.java:298)
at gnu.expr.GenericProc.applyN(GenericProc.java:120)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:193)
at gnu.mapping.ProcedureN.apply3(ProcedureN.java:48)
at com.google.youngandroid.runtime.$PcSetAndCoerceProperty$Ex(runtime325529575581311951.scm:1065)
at com.google.youngandroid.runtime.setAndCoerceProperty$Ex(runtime325529575581311951.scm:191)
at com.liveappbymorgan.Movai.Lista_Spesa.lambda14(Lista_Spesa.yail:78)
at com.liveappbymorgan.Movai.Lista_Spesa$frame.apply0(Lista_Spesa.yail:446)
at gnu.expr.ModuleBody.applyN(ModuleBody.java:226)
at gnu.expr.ModuleMethod.applyN(ModuleMethod.java:222)
at gnu.kawa.functions.ApplyToArgs.applyN(ApplyToArgs.java:139)
at gnu.mapping.ProcedureN.apply1(ProcedureN.java:31)
at com.liveappbymorgan.Movai.Lista_Spesa.$define(Lista_Spesa.yail:10200)
at com.google.appinventor.components.runtime.Form.onCreate(Form.java:246)
at android.app.Activity.performCreate(Activity.java:6550)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3102)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6872)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) is the Error Code

SteveJG

unread,
Nov 20, 2015, 1:42:37 PM11/20/15
to MIT App Inventor Forum
How do you switch between your screens?   If you are changing screens and not closing the screen you leave, you eventually gobble up system memory.  AI2 users are recommended to close the screen they leave (except for Screen1 which is never closed). the additional screens.  Why?   Each screen created with AI2 'behaves' as if it is a separate app, utilizing its own share of system memory.  If a user moves back and forth, the additional screen memory is never released and I believe the effect is cumulative.  Are you closing screens as you leave them? 

The issue you described is probably this, but it might be something else related to a memory leak in one of the routines you are using.

How to safely change and close screens  see here 

Manager Screen Demonstration and here Tribblehunter's Multiple Screen Method

Abraham Getzler

unread,
Nov 20, 2015, 4:02:55 PM11/20/15
to MIT App Inventor Forum
Two other possibilities ...

Big graphics images

Procedures calling themselves without exitting

Post screen shots of your blocks?

ABG

Reply all
Reply to author
Forward
0 new messages