Cuando cambio al modo de paisaje, se crean pocos objetos con mapa de bits de pantalla completa.el tamaño del mapa de bits excede el error de presupuesto de Vm android
Cuando me desplazo otro objeto se llama y se muestra su mapa de bits, cuando haciendo esto en varias ocasiones, el tamaño del mapa de bits excede vm
error presupuesto, he hecho todas las cosas como recycle()
, establecer nulo y entonces llamado GC()
, todavía tengo mismo error. crear mapa de bits ....
bitmap = Bitmap.createBitmap(ChartProperties.getChartWidth(),
ChartProperties.getChartHeight(),
Bitmap.Config.RGB_565);
imageCache.put(String.valueOf(LandscapeChartActivity.getActiveFeature()),
new SoftReference(bitmap));
if(imageCache != null){
for (int i = 0; i < imageCache.size(); i++) {
if (imageCache.get(String.valueOf(i)) != null) {
imageCache.get(String.valueOf(i)).get().recycle();
imageCache.put(String.valueOf(i), null);
}
}
Runtime.getRuntime().gc();
imageCache.clear();
imageCache = null;
posible duplicado de [OutOfMemoryError: tamaño de mapa de bits supera el presupuesto VM: - Android] (http://stackoverflow.com/questions/2928002/outofmemoryerror-bitmap-size-exceeds-vm-budget -android) –
Cada vez que llamas 'size()' en un bucle, Dios mata a un gatito ... – WarrenFaith