My app has been working perfectly for months, and I wanted to modify it slightly. I added two lines of code to a service module (comms) and I get a "failed to allocate memory" error message immediately after the app has loaded.
If I comment out those two lines of code, I don't get the error.
If I set a breakpoint on the two lines of code, the breakpoint is not hit.
The two lines of code are not in the "starter" service where the error is reportedly happening at line 107.
I don't expect anyone to solve the issue from these brief details, but perhaps someone can help me understand what the error log is saying, and suggest possible solutions.
Many thanks.
<CODE>
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (comms) Create ***
** Service (comms) Start **
java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:281)
at anywheresoftware.b4a.shell.ShellConnector.readList(ShellConnector.java:222)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSub(Shell.java:513)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:414)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.easyhost.comms._newdata(comms.java:139)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1058)
at b4a.easyhost.starter._astream_newdata(starter.java:211)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Error occurred on line: 107 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1058)
at b4a.easyhost.starter._astream_newdata(starter.java:211)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 18 more
Caused by: java.lang.RuntimeException: java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.easyhost.comms._newdata(comms.java:139)
... 20 more
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:281)
at anywheresoftware.b4a.shell.ShellConnector.readList(ShellConnector.java:222)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSub(Shell.java:513)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:414)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 22 more
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:270)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:344)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 8 more
</CODE>
If I comment out those two lines of code, I don't get the error.
If I set a breakpoint on the two lines of code, the breakpoint is not hit.
The two lines of code are not in the "starter" service where the error is reportedly happening at line 107.
I don't expect anyone to solve the issue from these brief details, but perhaps someone can help me understand what the error log is saying, and suggest possible solutions.
Many thanks.
<CODE>
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (comms) Create ***
** Service (comms) Start **
java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:281)
at anywheresoftware.b4a.shell.ShellConnector.readList(ShellConnector.java:222)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSub(Shell.java:513)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:414)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.easyhost.comms._newdata(comms.java:139)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1058)
at b4a.easyhost.starter._astream_newdata(starter.java:211)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Error occurred on line: 107 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1058)
at b4a.easyhost.starter._astream_newdata(starter.java:211)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 18 more
Caused by: java.lang.RuntimeException: java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.easyhost.comms._newdata(comms.java:139)
... 20 more
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 184560016 byte allocation with 6291456 free bytes and 58MB until OOM, target footprint 78779456, growth limit 134217728
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:281)
at anywheresoftware.b4a.shell.ShellConnector.readList(ShellConnector.java:222)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSub(Shell.java:513)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:414)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 22 more
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:270)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:344)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 8 more
</CODE>