Thanks sir very much, I have been test again, trust my problem that cause memory leaks of Bitmap.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote01-31 01:49:08.209: INFO/StreetsDrawable(26528): Begin Draw Streets
01-31 01:49:08.219: INFO/StreetsDrawable(26528): 0----0
01-31 01:49:08.219: INFO/StreetsDrawable(26528): -279-----77
01-31 01:49:08.219: INFO/StreetsDrawable(26528): -1161-----222
01-31 01:49:08.219: INFO/StreetsDrawable(26528): The End Draw Streets
01-31 01:49:08.529: INFO/jPCT-AE(26528): Loading Texture...
01-31 01:49:08.569: DEBUG/lib_locapi(4670): loc_eng_report_status: GPS_STATUS_SESSION_BEGIN
01-31 01:49:08.679: DEBUG/dalvikvm(26528): GC_FOR_MALLOC freed 791 objects / 39288 bytes in 154ms
01-31 01:49:08.699: INFO/dalvikvm-heap(26528): Grow heap (frag case) to 21.244MB for 1048592-byte allocation
QuoteDrawable streets;
streets= new StreetsDrawable(lsGeo);
Bitmap bitmap = Bitmap.createBitmap(IMG_WIDTH,
IMG_HEIGHT, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
streets.draw(c);
Texture streetsTexture = null;
QuotestreetsTexture = new Texture(BitmapHelper.rescale(bitmap, 256, 256));streetsTexture.setMipmap(true);
freeBitmap(bitmap);
if(tm.containsTexture("streets")){
tm.removeAndUnload("streets",fb);
tm.replaceTexture("streets",streetsTexture);
}else{
tm.addTexture("streets", streetsTexture);
}
QuoteDrawable streets;
streets= new StreetsDrawable(lsGeo);
Bitmap bitmap = Bitmap.createBitmap(IMG_WIDTH,
IMG_HEIGHT, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
streets.draw(c);
Texture streetsTexture = null;
streetsTexture = new Texture(bitmap);
streetsTexture.setMipmap(true);
if (bitmap != null) {
bitmap.recycle();
bitmap = null;
System.gc();
}
if(tm.containsTexture("streets")){
tm.removeAndUnload("streets",fb);
tm.replaceTexture("streets",streetsTexture);
}else{
tm.addTexture("streets", streetsTexture);
}
QuoteGrow heap (frag case) to xxxxMB for xxxx-byte allocationxxxx is number memory increase than every time draw invalidate streets.
Quote01-30 01:17:43.201: INFO/jPCT-AE(12715): Loading Texture...
01-30 01:17:43.201: INFO/jPCT-AE(12715): [ 1296325063209 ] - WARNING: Unsupported Texture width (250)...resizing to 128...
Quote01-29 12:28:34.558: ERROR/dalvikvm-heap(6950): Out of memory on a 1048592-byte allocation.
01-29 12:28:34.558: INFO/dalvikvm(6950): "GLThread 12" prio=5 tid=9 RUNNABLE
01-29 12:28:34.558: INFO/dalvikvm(6950): | group="main" sCount=0 dsCount=0 s=N obj=0x460069c0 self=0x37e000
01-29 12:28:34.558: INFO/dalvikvm(6950): | sysTid=6972 nice=0 sched=0/0 cgrp=default handle=3409408
01-29 12:28:34.558: INFO/dalvikvm(6950): | schedstat=( 33403747505 41698944175 45115 )
01-29 12:28:34.558: INFO/dalvikvm(6950): at com.threed.jpct.Texture.loadTexture(Texture.java:~754)
01-29 12:28:34.558: INFO/dalvikvm(6950): at com.threed.jpct.Texture.loadTexture(Texture.java:667)
01-29 12:28:34.558: INFO/dalvikvm(6950): at com.threed.jpct.Texture.<init>(Texture.java:175)
01-29 12:28:34.558: INFO/dalvikvm(6950): at com.splendor.app.directions.ar.ARDirectionsRenderer.onDrawFrame(ARDirectionsRenderer.java:99)
01-29 12:28:34.558: INFO/dalvikvm(6950): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1341)
01-29 12:28:34.558: INFO/dalvikvm(6950): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
01-29 12:28:34.558: ERROR/dalvikvm(6950): Out of memory: Heap Size=16647KB, Allocated=13817KB, Bitmap Size=7275KB
Quote
01-29 12:28:04.758: INFO/jPCT-AE(6950): Loading Texture...
01-29 12:28:04.758: INFO/jPCT-AE(6950): [ 1296278884762 ] - WARNING: Unsupported Texture width (1000)...resizing to 512...
01-29 12:28:04.898: INFO/dalvikvm-heap(6950): Grow heap (frag case) to 19.895MB for 1048592-byte allocation
01-29 12:28:31.688: INFO/jPCT-AE(6950): Loading Texture...
01-29 12:28:31.688: INFO/jPCT-AE(6950): [ 1296278911692 ] - WARNING: Unsupported Texture width (1000)...resizing to 512...
01-29 12:28:32.168: INFO/dalvikvm-heap(6950): Grow heap (frag case) to 20.895MB for 1048592-byte allocation
Quote@Override
public void onDrawFrame(GL10 arg0) {
try {
if (!stop) {
setCameraOrientation(mOrientationValue);
if(mSteps!=null){
List<GeoLocation> lsGeo=checkSteps(mSteps, mCurloc, IMG_WIDTH);
Drawable streets;
streets= new StreetsDrawable(lsGeo);
Bitmap bitmap = Bitmap.createBitmap(IMG_WIDTH,
IMG_HEIGHT, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
streets.draw(c);
Texture streetsTexture = null;
streetsTexture = new Texture(bitmap);
streetsTexture.setMipmap(true);
if (bitmap != null) {
bitmap.recycle();
bitmap = null;
System.gc();
}
if(tm.containsTexture("streets")){
tm.removeTexture("streets");
}
tm.addTexture("streets",streetsTexture);
c=null;
streetsTexture=null;
System.gc();
streets=null;
mSteps=null;
lsGeo=null;
}
fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();
} else {
if (fb != null) {
fb.dispose();
fb = null;
}
}
} catch (Exception e) {
Logger.log(e, Logger.MESSAGE);
}
}
Page created in 0.017 seconds with 12 queries.