Objectbox-java: question about logs

Created on 28 Sep 2017  Â·  29Comments  Â·  Source: objectbox/objectbox-java

i have too many this logs from my app, is it normal or something is wrong ?

W/Box: Skipping low-level close for read-only cursor (non-creator thread)
W/Box: Destroyed recycled transaction from non-owner thread
bug

Most helpful comment

Hello @greenrobot

Sorry for the waiting
Since i cant share the original source code, i created a simple proyect that reproduces this behaviour in the logs

Hope this helps: https://github.com/rudikiaz/ObjectboxLogsTest
As i wrote on the readme, i think its related to the indexs

All 29 comments

Do you know which code triggers this?

@greenrobot unfortunately no, but i can find it, it's important ?

No hurry, but would be nice...

I have this kind of log too

I got it on Android 5.1 during the try to get 23167 entities from DB. Actually application freeze each time when I'm trying to do that. I can provide more details if it is necessary.

@Yazon2006 ObjectBox 1.4.x? Or at least 1.3.4? If so, I'd be happy to look into some details.

@greenrobot for me in 1.4.x same logs exists

I assume this happens in short lived threads? Please call BoxStore.closeThreadResources() for Threads that are about to end. Let us know if that makes the logs go away.

Background: it's preferable when resources are closed in the same thread, which is not what happens with Java garbage collection.

@greenrobot Yeah. It looks like during heavy transactions GC trying to clear memory and thats why transaction become recycled from non-owner thread. It seems to me that nothing to worry about cause object box still work as expected. Thank you for assisting.

We are thinking about a new method passing a Runnable to ObjectBox. Like you would do with a thread pool, but ObjectBox could clean up its resources automatically. What do you think?

@greenrobot Cleaning up resources automatically it's a good idea. Improving memory consumption is always good)

@greenrobot I see this logs often. I have ~30 threads that use one instance of box and boxStore. Threads lives all the time app is running. Can this log indicate about memory leak? If so, how to fix it?

I get same logs, how to fix it?

it often occur when --> box.put() function operating frequency。

Still happening on 2.0 (Kotlin). The message "Skipped low-level close of cursor" appears every time you modify the database (put or delete, for example)

Example:

val box = store.boxFor(CLASS::class.java)
box.removeAll()
box.put(DATA)

Output:

[WARN ] Skipped low-level close of cursor (write, TX #3 alive)
[WARN ] Skipped low-level close of cursor (write, TX #4 alive)

@greenrobot this warning is very worrying there is some fix already?

It should not be a big thing.

Please call BoxStore.closeThreadResources() for Threads that are about to end. Let us know if that makes the logs go away.

Have you tried this?

We get that warning even in our tests which are all run in a single thread. We get this warning for every single put operation.

edit: we have tried closeThreadResources() but the logs keeps appearing

Hi, we've got the same issue over here..

We have tried closeThreadResources() but it doesn't make much sense for us since we're running a single thread. We get the warning for every single put/delete operation. Logs get quite crowded with that warning. I'm wondering why this is happening.

@greenrobot Any more feedback on what could we try or do in order to help solving this issue??

Could you provide some simple code to reproduce what's happening on your side?

Got the same problem here in v2.1.0. Happens when I put a deep object with relations which have relations which have relations which..., but I don't have any reproducible code at the moment (can't share this project's code unfortunately). Most of the relations have backlinks and the put is happening in a thread from an executor. Also tried putting it in a TX call, but didn't change anything, except for the logs to be grouped together by "chatty" as the TX call keeps the TX ID the same. Will try to see if I can reproduce this in a standalone project, if so, I'll post it here, but so far I've been unable to reproduce it standalone.

Also, closeThreadResources() doesn't seem to do anything to the message

Hello @greenrobot

Sorry for the waiting
Since i cant share the original source code, i created a simple proyect that reproduces this behaviour in the logs

Hope this helps: https://github.com/rudikiaz/ObjectboxLogsTest
As i wrote on the readme, i think its related to the indexs

Thanks @rudikiaz, could verify. This is also reproduced by our internal tests using indexes.

Cleaned up the Kotlin example to minimal code to reproduce:
196ObjectboxLogsTest.zip

Also reported internally to our development team.

-ut

whenever i use remove or put i am getting this message , i hope it is not a big deal , so far going good with it.

@Gamezpedia Your app should be fine. We are investigating this already. -ut

image

I also encounter this situation here, has been crazy to print this log, the program is frozen can not be used properly.

version:2.3.4
Android:5.1.0

@guqh This is probably amplified by the way you have been using Query (#753).

This was fixed internally and should be available with the next update. Thanks for all the reports.

This is also part of the just released version '2.4.0-RC' - would be great if you could give it a try and report back. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rohitgupta1694 picture rohitgupta1694  Â·  4Comments

cincospenguinos picture cincospenguinos  Â·  5Comments

hendrawd picture hendrawd  Â·  5Comments

zoltish picture zoltish  Â·  4Comments

ScottPierce picture ScottPierce  Â·  3Comments