My application has a lot of images and sometimes it crashes due to low memory. I wrote this function that I found on the developer site.
public void onLowM
From API level 14, there's method called onTrimMemory(int) that fit your need.
onTrimMemory(int)
Here's the doc:
http://developer.android.com/reference/android/content/ComponentCallbacks2.html
You're able to be notified when the system is about to recollect memory and also how critical the current situation is.