ROOM OutOfMemoryError R(OOM)

lig*_*igi 6 android out-of-memory android-room android-livedata

我在播放控制台中看到了这些错误.有人知道如何最好地处理房间内的OOM错误吗?

java.lang.OutOfMemoryError: 
  at android.database.CursorWindow.nativeGetString (Native Method)
  at android.database.CursorWindow.getString (CursorWindow.java:451)
  at android.database.AbstractWindowedCursor.getString (AbstractWindowedCursor.java:51)
  at org.walleth.data.transactions.TransactionDAO_Impl$8.compute (TransactionDAO_Impl.java:1272)
  at org.walleth.data.transactions.TransactionDAO_Impl$8.compute (TransactionDAO_Impl.java:1212)
  at android.arch.lifecycle.ComputableLiveData$2.run (ComputableLiveData.java:87)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
  at java.lang.Thread.run (Thread.java:762)
Run Code Online (Sandbox Code Playgroud)

Adi*_*rzi 2

您要同时传输大量数据吗?

如果您要填写的是一个列表,您可以懒惰地填写,例如将其填入 100 x 100。

另外,如果数据库的响应有很多列,SELECT则您使用的列。