Android Question .OutOfMemoryError: Failed to allocate

Status
Not open for further replies.

nicieri

Active Member
Licensed User
Longtime User
Hello, I have an app, the same code in B4i works for me without problem, but in B4a, it gives me this error, what can I do to avoid it?

Thanks.

B4X:
java.lang.OutOfMemoryError: Failed to allocate a 8208 byte allocation with 42488 free bytes and 41KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
    at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:75)
    at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:58)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:449)
    at com.ciericorp.voyarist.httputils2service._hc_responsesuccess(httputils2service.java:167)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
    at anywheresoftware.b4a.BA$2.run(BA.java:395)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8385)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:640)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:982)
java.lang.RuntimeException: java.lang.OutOfMemoryError: Failed to allocate a 8208 byte allocation with 42488 free bytes and 41KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:188)
    at anywheresoftware.b4a.BA$2.run(BA.java:395)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8385)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:640)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:982)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 8208 byte allocation with 42488 free bytes and 41KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
    at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:75)
    at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:58)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:449)
    at com.ciericorp.voyarist.httputils2service._hc_responsesuccess(httputils2service.java:167)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
 

joko0124

Member
Licensed User
Longtime User
Got this problem too. My app runs and install smoothly in my emulator, but using an actual device, i can unable to install it
I don't know the problem
 
Upvote 0
Status
Not open for further replies.
Top