There was an answer in SO about freeing up memory manually. I couldn't find it now so I am pasting the answer I am implementing
Define the following function
//To free up memory taken by adapterViews and others
private void unbindDrawables(View view) {
if (view.getBackground() != null)
view.getBackground().setCallback(null);
if (view instanceof ImageView) {
ImageView imageView = (ImageView) view;
imageView.setImageBitmap(null);
} else if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++)
unbindDrawables(viewGroup.getChildAt(i));
if (!(view instanceof AdapterView))
viewGroup.removeAllViews();
}
}
then in your onDestroy method use
unbindDrawables(findViewById(R.id.view_to_unbind));
System.gc();
This has stopped my app from crashing on orientation change.