i have found this solution by Erel but can't locate b4a ini file
You can increase the memory size that the dexer process is allowed to use.
Open the ini file that is located in:
C:\Users\<Your user name>\AppData\Roaming\Anywhere Software\Basic4android
Change this line:
MaxRamForDex=1024
To:
MaxRamForDex=2048
Note that you must do this change when Basic4android is closed. Otherwise it will override the change when it gets closed (and it reads it only when it opens).
You can also disable the debugger (Project - Attach debugger).