Jit: Redimensionar JitTable de 512 a 1024 y así sucesivamente … ¿qué es esto?

El desarrollo de una aplicación para Android por semanas y ahora me di cuenta de que tengo mensajes como este en catlog:

Jit: Resizing JitTable from 512 to 1024 (...) Jit: Resizing JitTable from 1024 to 2048 (...) Jit: Resizing JitTable from 2048 to 4096 

Lo que se quiere decir ? ¿Es una fuga de memoria o algo así?

Y también tengo esto en la (…) zona:

 04-24 07:59:53.131: D/dalvikvm(874): GC_EXTERNAL_ALLOC freed 207K, 48% free 2980K/5639K, external 1448K/1458K, paused 66ms 04-24 07:59:57.591: D/dalvikvm(874): GC_CONCURRENT freed 162K, 46% free 3122K/5767K, external 1371K/1673K, paused 11ms+17ms 04-24 07:59:58.771: D/dalvikvm(874): GC_CONCURRENT freed 196K, 44% free 3445K/6087K, external 1145K/1657K, paused 10ms+6ms 04-24 08:00:01.411: D/dalvikvm(874): GC_CONCURRENT freed 274K, 39% free 4267K/6983K, external 1145K/1657K, paused 6ms+7ms 04-24 08:00:04.970: D/dalvikvm(874): GC_EXTERNAL_ALLOC freed 31K, 36% free 4479K/6983K, external 1145K/1657K, paused 89ms 

Aproximadamente en el 14% libre, conseguí un desplome.

Esto sucede cuando hago clic en los botones de menú (cambiar actividades). Pruebo en emulador, no sé los resultados en el teléfono …

El error al bloquear en logcat:

 04-24 08:26:34.158: E/GraphicsJNI(482): VM won't let us allocate 1536000 bytes 04-24 08:26:34.158: D/dalvikvm(482): GC_FOR_MALLOC freed 0K, 64% free 4280K/11655K, external 11662K/13614K, paused 72ms 04-24 08:26:34.158: D/skia(482): --- decoder->decode returned false 04-24 08:26:34.168: D/AndroidRuntime(482): Shutting down VM 04-24 08:26:34.168: W/dalvikvm(482): threadid=1: thread exiting with uncaught exception (group=0x40015560) 04-24 08:26:34.218: E/AndroidRuntime(482): FATAL EXCEPTION: main 04-24 08:34:37.807: E/AndroidRuntime(522): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 04-24 08:26:34.218: E/AndroidRuntime(482): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.KeySoft.OpenGuide/com.KeySoft.OpenGuide.Favourites}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown> 04-24 08:34:37.807: E/AndroidRuntime(522): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:470) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:284) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.KeySoft.OpenGuide.Top20.readBitmapImage(Top20.java:483) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.KeySoft.OpenGuide.Top20.addShopToList(Top20.java:251) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.KeySoft.OpenGuide.Top20.SqlShopsVissza(Top20.java:439) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.KeySoft.OpenGuide.Top20.onCreate(Top20.java:182) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.os.Handler.dispatchMessage(Handler.java:99) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.os.Looper.loop(Looper.java:130) 04-24 08:34:37.807: E/AndroidRuntime(522): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-24 08:34:37.807: E/AndroidRuntime(522): at java.lang.reflect.Method.invokeNative(Native Method) 04-24 08:34:37.807: E/AndroidRuntime(522): at java.lang.reflect.Method.invoke(Method.java:507) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 04-24 08:34:37.807: E/AndroidRuntime(522): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-24 08:34:37.807: E/AndroidRuntime(522): at dalvik.system.NativeStart.main(Native Method) 

Yo uso 256 MB de RAM en el emulador … tal vez puedo evitar todo esto con dispositivos reales? Dispositivos baratos también tiene al menos 384 MB Ram (Galaxy Mini) pero oftem más …

Como usted ha pedido en comentario I use a 800x480 image. How can i make a good background with smaller size ? I use a 800x480 image. How can i make a good background with smaller size ?

A continuación se muestra un fragmento de código que le permitirá cambiar el tamaño de un mapa de bits.

 public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeight) / height; // create a matrix for the manipulation Matrix matrix = new Matrix(); // resize the bit map matrix.postScale(scaleWidth, scaleHeight); // recreate the new Bitmap Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, false); return resizedBitmap; } 

Pregunta 1: No es una fuga de memoria. JitTable es el uso para la referencia del almacén jni. Por ejemplo, cuando se llama NewGlobalRef Api el JitTable aumentará 1 registro.

Este registro significa JitTable no es suficiente, la máquina virtual cambiará el tamaño automáticamente. Así que no se preocupe, usted apenas subsiste la referencia inútil de la liberación correcta. está bien.

Pregunta 2:
GC_EXTERNAL_ALLOC, cuando se asigna memoria nativa pero la memoria no es suficiente, se llama al GC. GC_CONCURRENT, cuando asigna un tamaño de objeto mayor que 384K https://developer.android.com/tools/debugging/debugging-memory.html#LogMessages

  • Aplicación de Android con límite de tamaño de memoria
  • Java - android UDP falta de fiabilidad
  • Leyendo LeakCanary Log
  • Problema con la descarga de varios archivos con AsyncTask
  • Actividad ha filtrado ventana com.android.internal.policy.impl.PhoneWindow$DecorView@44f72ff0 que fue agregado originalmente aquí
  • ¿Por qué se trata de una pérdida de memoria
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.