There are a few possibilities but the most common is creating an array that is too large for the heap space (allocated memory) to contain.
You can do a couple of things: check your code to make sure your arrays aren't bigger than you need and that your code is correct. If your code is correct or you can't change it, about the only other thing you can do is increase the heap space:
Start the application with the command line switch: -XmxSizeUnits
for example:
To set a max heap size of 128Mb use: java -Xmx128m
To set a max heap size of 640kb use: java -Xmx640k
I'm new to B4A, so I don't know yet how to change the java compiler directives from inside the IDE. Perhaps someone else can provide that info ..
Cheers