If you're not getting OutOfMemoryError
, altering the heap size won't affect the behavior.
Dalvik's managed heap resists growth in an attempt to minimize the app's memory footprint, and unfortunately will sometimes get "hung up" on a particular size. It's usually possible to kluge around this by allocating a large object (say, a byte[1000000]
) and immediately dropping the reference to it.
FWIW, the best way to guarantee the reference is dropped is to allocate it in a method that returns immediately. Don't just null out a reference. The Dalvik GC is not live-precise, so it won't ignore "dead" references lingering in registers.
(All of the above is for Android 4.4 and earlier. Hopefully the situation will improve in future releases.)