2

我有时会看到带有 android.database.CursorWindowAllocationException 的崩溃报告,这表明存在泄漏,就像在分配游标时出现的其他 SO 问题 Out of Memory但我的异常有 '# Open Cursors=1 (# cursors opens by this proc =1)' 看起来我周围没有很多光标。

我正在使用 ORMLite,我想知道是否有什么办法可以准确地找出问题所在?

异常的堆栈跟踪如下所示:

android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=1 (# cursors opened by this proc=1)
at android.database.CursorWindow.<init>(CursorWindow.java:104)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:162)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:161)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:201)
at com.j256.ormlite.android.AndroidDatabaseResults.first(AndroidDatabaseResults.java:73)
at com.j256.ormlite.android.AndroidDatabaseConnection.queryForOne(AndroidDatabaseConnection.java:176)
at com.j256.ormlite.stmt.mapped.MappedQueryForId.execute(MappedQueryForId.java:38)
at com.j256.ormlite.field.FieldType.assignField(FieldType.java:533)
at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:71)
at com.j256.ormlite.stmt.StatementExecutor.queryForFirst(StatementExecutor.java:97)
at com.j256.ormlite.dao.BaseDaoImpl.queryForFirst(BaseDaoImpl.java:231)
at com.our.company.service.DownloadService.getLatestVoucherUpdate(DownloadService.java:354)
at com.our.company.service.DownloadService.downloadVouchers(DownloadService.java:831)
at com.our.company.service.DownloadService.onHandleIntent(DownloadService.java:1483)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
4

0 回答 0