-
Notifications
You must be signed in to change notification settings - Fork 388
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
Hawk.put app Freeze #54
Comments
Do you have any output/stacktrace to find out the issue? Could be something else |
This is what happening when arrives at the line "Hawk.put("test",true);" 07-17 14:00:13.236 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 91636(6MB) AllocSpace objects, 1(16KB) LOS objects, 6% free, 95MB/101MB, paused 12.591ms total 56.190ms |
I have also see something weird... |
Another weird thing!!!! E/dalvikvm﹕ Could not find class 'com.orhanobut.hawk.Hawk$2', referenced from method com.orhanobut.hawk.Hawk.putObservable |
|
|
Issue might be that a huge amount of data that sharedpreferences cannot handle. Can you try with the new version? I've added sqlite storage option, amount shouldn't be issue anymore. |
Error:Could not find com.orhanobut:hawk:1.17. |
I reupload the artifacts, apparently had some issues with maven central. It will be available in a few minutes |
Problem is not solved: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. |
Actually what i am doind is this.
|
With the new version you also need to call build() Hawk.init(this).setStorage(HawkBuilder.newSqliteStorage(this)).build(): then can you put items and try? |
I have called build |
and you still get the same error? |
Yes, actually is not an error, the app is freezing and in the console i got the same "errors" i have posted you before. |
Ok, after some deep research inside my code i have understand where the problem was. It happens when i try to save to Hawk an object that have a Drawable as an attribute. So when i try to save that object, the application freeze and the LogCat shows the output i have posted you up there. It is not important for me to save that Drawable, i can do it in other ways, removing that the problem is solved. Thanks. PS: Keep improving this awesome Lib! |
That's great news, just for info, you can also use transient keyword to avoid drawable to be serialized/deserialized |
When i read from Hawk my 8k Objects the application seems to go in OOM, what i can do to avoid that? |
I cannot think of any good solution for this problem unfortunately. |
I'll close this issue and we can create another oom enhancement maybe but still the problem is caused by memory which hawk cannot do anything apparently. |
Now i am adding those objects as pieces of 50. No OOM happens anymore. |
App if freezing and what i am doing is :
Hawk.put("test", true);
Why this?
The text was updated successfully, but these errors were encountered: