B4X:
Dim r As Reflector
r.RunStaticMethod("java.lang.System", "gc", Null, Null)
After releasing a new version of my app I have been getting crash reports of "OutOfMemory" like this invoked after calling canvas.initialize. Why are three bitmaps being created?
B4X:
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:928)
at android.graphics.Bitmap.createBitmap(Bitmap.java:901)
at android.graphics.Bitmap.createBitmap(Bitmap.java:868)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:76)
One solution recommended adding the above code to Activity_Pause (UserClosed=true)
Out of 10 crashes 8 are from Galaxy devices which seem to have a problem with memory allocation. The other two are from a Sharp and Fujitsu phone.