I have a terminal app that can build android apps on my phone. I don't have a computer that I can use to program. So anyway when my app grows in size the dx tool running in the terminal on my android phone throws java.lang.OutOfMemmoryError even though the terminal only uses 20mb of memmory
After some time I found the solution the dx tool in my phone is basically a shell script that invokes the dalvik virtual machine to execute the dx tool. The solution is to add -Xms30m to the command that invoke dalvik vm. It gives the dx tool 30 mb of heap if that isn't enough,just increase the number.