我正在尝试使用eclipse调试一些Android opengles足球游戏(我的Android设备是戴尔Streak pad)。当游戏进入某场比赛时(让我们说一个世界杯比赛),eclipse调试器需要花费很长时间,不幸的是因为outofmemoryerror异常而失败。
这是崩溃的调用堆栈:
主题[< 1> main](Suspended(例外OutOfMemoryError)) Bitmap.createBitmap(int,int,Bitmap $ Config,boolean)行:604 Bitmap.createBitmap(int,int,Bitmap $ Config)行:584
ActivityThread.createThumbnailBitmap(ActivityThread $ ActivityClientRecord) 行:2442
ActivityThread.performStopActivityInner(ActivityThread $ ActivityClientRecord, ActivityThread $ StopInfo,boolean,boolean)line:2615 ActivityThread.handleStopActivity(IBinder,boolean,int)行:2689 ActivityThread.access $ 800(ActivityThread,IBinder,boolean,int) line:122 BinderProxy(ActivityThread $ H).handleMessage(Message)行: 1038 ActivityThread $ H(处理程序).dispatchMessage(消息)行:99 Looper.loop()行:132 ActivityThread.main(String [])行:4123
Method.invokeNative(Object,Object [],Class,Class [],Class,int, boolean)line:not available [native method] Method.invoke(Object, 对象...)行:491 ZygoteInit $ MethodAndArgsCaller.run()行:841
ZygoteInit.main(String [])行:599 NativeStart.main(String []) line:not available [native method]守护程序系统线程[< 2> HeapWorker](暂停(异常OutOfMemoryError)) BinderInternal $ GcWatcher.finalize()行:48
NativeStart.run()行:不可用[本机方法]主题[< 9> GLThread 10](暂停(异常OutOfMemoryError)) GLSurfaceView $ GLThread.run()行:1188
还有一些关于logcat的信息:
02-25 15:07:33.931: DEBUG/dalvikvm(17453): threadid=2: still suspended after undo (sc=1 dc=1)
02-25 15:07:33.931: DEBUG/dalvikvm(17453): GC_BEFORE_OOM freed 0K, 1% free 48888K/49159K, paused 414ms
02-25 15:07:33.931: ERROR/dalvikvm-heap(17453): Out of memory on a 62116-byte allocation.
02-25 15:07:33.931: DEBUG/dalvikvm(17453): threadid=9: still suspended after undo (sc=1 dc=1)
02-25 15:07:33.931: INFO/dalvikvm(17453): "main" prio=5 tid=1 RUNNABLE
02-25 15:07:33.931: INFO/dalvikvm(17453): | group="main" sCount=0 dsCount=0 obj=0x4014b5c8 self=0x125f8
02-25 15:07:33.931: INFO/dalvikvm(17453): | sysTid=17453 nice=0 sched=0/0 cgrp=default handle=-1342909336
02-25 15:07:33.931: INFO/dalvikvm(17453): | schedstat=( 0 0 0 ) utm=249 stm=13 core=1
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.graphics.Bitmap.nativeCreate(Native Method)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.graphics.Bitmap.createBitmap(Bitmap.java:604)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.graphics.Bitmap.createBitmap(Bitmap.java:584)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread.createThumbnailBitmap(ActivityThread.java:2442)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:2615)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread.handleStopActivity(ActivityThread.java:2689)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread.access$800(ActivityThread.java:122)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.os.Handler.dispatchMessage(Handler.java:99)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.os.Looper.loop(Looper.java:132)
02-25 15:07:33.931: INFO/dalvikvm(17453): at android.app.ActivityThread.main(ActivityThread.java:4123)
02-25 15:07:33.931: INFO/dalvikvm(17453): at java.lang.reflect.Method.invokeNative(Native Method)
02-25 15:07:33.931: INFO/dalvikvm(17453): at java.lang.reflect.Method.invoke(Method.java:491)
02-25 15:07:33.931: INFO/dalvikvm(17453): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
02-25 15:07:33.931: INFO/dalvikvm(17453): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
02-25 15:07:33.931: INFO/dalvikvm(17453): at dalvik.system.NativeStart.main(Native Method)
等等。
我试图直接在我的Android设备上运行它,事情似乎没事,没有崩溃,并且需要花费可接受的时间才能加载&跑。我想知道是不是因为vm堆内存不够,所以我试图在eclipse.ini中增加vm内存值,之后我也关闭了eclipse并重启了它:
- launcher.XXMaxPermSize 1024m -XX:MaxPermSize = 1024m -Xms256m -Xmx1024m
但它不起作用。虽然它在设备上运行良好,但我需要调试游戏匹配断点,踩踏。没有调试,就会非常糟糕。任何知道这件事的人都可以帮我解决这个问题。
注意:我正在调试设备上的opengles游戏(如我所提到的dell streak pad),因此模拟器不支持opengles会有问题。
答案 0 :(得分:0)
此时仿真器无法执行opengl,您只能使用真实设备来测试opengl应用程序。