Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StorIOException #778

Closed
MerlinYu opened this issue Apr 17, 2017 · 3 comments
Closed

StorIOException #778

MerlinYu opened this issue Apr 17, 2017 · 3 comments
Assignees

Comments

@MerlinYu
Copy link

om.pushtorefresh.storio.StorIOException: android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.
at com.pushtorefresh.storio.sqlite.operations.put.PreparedPutCollectionOfObjects.executeAsBlocking(SourceFile:148)
at com.imaygou.android.data.MomosoDbManager.a(SourceFile:174)
at com.imaygou.android.brand.BrandService.c(SourceFile:135)
at com.imaygou.android.brand.BrandService.onHandleIntent(SourceFile:66)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:179)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.
at android.database.CursorWindow.(CursorWindow.java:108)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:138)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)
at com.pushtorefresh.storio.sqlite.operations.put.DefaultPutResolver.performPut(SourceFile:74)
at com.pushtorefresh.storio.sqlite.operations.put.PreparedPutCollectionOfObjects.executeAsBlocking(SourceFile:112)
... 7 more

@nikitin-da
Copy link
Collaborator

Hi, @MerlinYu ! #779 contains almost the same log so I move it here.
android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. at android.database.CursorWindow.(CursorWindow.java:108) at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198) at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:138) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) at com.pushtorefresh.storio.sqlite.operations.put.DefaultPutResolver.performPut(SourceFile:74) at com.pushtorefresh.storio.sqlite.operations.put.PreparedPutCollectionOfObjects.executeAsBlocking(SourceFile:112) at com.imaygou.android.data.MomosoDbManager.a(SourceFile:174) at com.imaygou.android.brand.BrandService.c(SourceFile:135) at com.imaygou.android.brand.BrandService.onHandleIntent(SourceFile:66) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:179) at android.os.HandlerThread.run(HandlerThread.java:61)

@nikitin-da
Copy link
Collaborator

It seems the problem is that cursors were not closed after usage.
Particular places were not the cause since cursor is handled correctly: numberOfResults() and put().
Do you use storIoSqlite.get().cursor()? For this case you should close cursor manually after usage.

Also StrictMode can help to identify such places:

if (BuildConfig.DEBUG) {     
   StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
      .detectLeakedSqlLiteObjects()
      .detectLeakedClosableObjects()
      .penaltyLog()
      .penaltyDeath()
      .build());
}

@nikitin-da nikitin-da self-assigned this Apr 17, 2017
@artem-zinnatullin
Copy link
Member

Looks like this issue can be closed, feel free to comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants