In your onCreate method in your activity or, if you want all your applications in the package, the onCreate application custom object, add
dalvik.system.VMRuntime.getRuntime().setMinimumHeapSize(yournumberhere);
Edit: Also note that Android will automatically increase the heap size if it needs more. Therefore, although the default value may be 16, if it needs more, it will increase it. However, this can lead to a small malfunction in a real-time situation, which is bad. Therefore, if you know that this will last up to 16 years, do it in advance.
source share