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
Cursor RxCachedThreadSchedules Storage error code -30790 #753
Comments
Could not begin read transaction (maximum of read transactions reached) |
io.objectbox.exception.DbMaxReadersExceededException: Could not begin read transaction (maximum of read transactions reached) (error code -30790) |
Original: 对的是一个问题,是否query 后需要手动释放资源? Translation: The right thing is a question. Is it necessary to manually release resources after query? |
Does However, best practice is to cache and reuse the Query object (do not always create a new one). |
Original: 还有您说的缓存具体是指什么? Translation: What else do you mean by the cache? |
Original: 是我每次box.query()就会生成一个cursor还是?每次box.query()...build()后会生成一个新的cursor? Translation: Is it every time I make a cursor in box.query() or does it generate a new cursor every time box.query()...build()? |
Original: 是我每次box.query()就会生成一个cursor?还是每次box.query()...build()后会生成一个新的cursor? Translation: Is every time my box.query() generates a cursor? Or does it generate a new cursor every time after box.query()...build()? |
java.lang.IllegalStateException: This QueryBuilder has already been closed. Please use a new instance. Original: 根本无法重用这个query Translation: I can't reuse this query at all. |
Please tell me how to release cursor resources. |
What action will cursor be created and released manually? |
Original: Translation: |
@greenrobot-team @greenrobot Please help me,Thank you very much! |
@guqh To better help you: can you tell us about the class from which you use the query? Is this class longer lived, e.g. Activity? Is the query run always from a the same thread? @greenrobot-team We should prep some "code recipe" for this... |
Please check this example demonstrating the multi-threaded usage of cached query: |
Translation: Just like a screenshot, every query is done in my child thread. When the current acitivity is destroyed, we will release the disposableList of rx. |
Original: 但是从自动化压测来看,是query 对象,没有释放,持有的rx线程导致无法释放,造成泄漏,累积会出现oom Translation: But from the point of view of automated pressure measurement, it is a query object, there is no release, the rx thread held can not be released, causing a leak, and the accumulation will appear oom |
@guqh Did this example help, which I shared yesterday?
|
Closing this issue due to inactivity. 💤 Feel free to re-open with more details or submit a new issue. |
@guqh 请问这个问题你当时怎么解决的,我现在在压测中也遇到这个问题了,native的内存占用一直在持续增长。 |
记得好像是 rx java 使用不对,线程没有被释放,一直无限新增线程导致的。 |
不知道是 Cursor 导致 rxThread 无法释放还是RxThread 导致 Cursor 无法释放,一直持续增长
The text was updated successfully, but these errors were encountered: