So I have a simple Activity with following code:
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentByTag("tag");
if(fragment == null) {
fragment = new SupportMapFragment();
getSupportFragmentManager().beginTransaction()
.replace(android.R.id.content, fragment, "tag").commit();
}
}
}
When I keep on rotating the screen I can see the memory heap is increasing in DDMS. Even if I do several GCs the memory never returns to a normal level. Am I doing something wrong or did Google just release their new maps api with a serious memory leak?
Tested on HTC Desire - Android 2.2.2
Edit: Also tested on Samsung galaxy S3 - Android 4.1.2
Edit: Didn't give OOM but the heap doesn't fall down before I move around on the map etc.