Comments (21)
Do you have any output/stacktrace to find out the issue? Could be something else
from hawk.
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
07-17 14:00:13.250 8830-8842/com.showcase.myapp W/unknown:CloseableReference﹕ Finalized without closing: 147ad8a2 159bc933 (type = NativePooledByteBuffer)
07-17 14:00:13.254 8830-8842/com.showcase.myapp W/unknown:CloseableReference﹕ Finalized without closing: 3b1464f0 20104a69 (type = NativePooledByteBuffer)
07-17 14:00:13.735 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 46.784ms
07-17 14:00:13.741 8830-8845/com.showcase.myapp W/art﹕ Suspending all threads took: 5.518ms
07-17 14:00:13.780 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 141100(6MB) AllocSpace objects, 7(26MB) LOS objects, 18% free, 68MB/84MB, paused 11.053ms total 96.966ms
07-17 14:00:14.906 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 321321(15MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 70MB/78MB, paused 7.274ms total 91.327ms
07-17 14:00:15.510 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 169084(8MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 70MB/86MB, paused 8.637ms total 105.739ms
07-17 14:00:16.838 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 344093(15MB) AllocSpace objects, 15(181KB) LOS objects, 10% free, 71MB/79MB, paused 13.539ms total 128.486ms
07-17 14:00:17.538 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 188494(6MB) AllocSpace objects, 163(2MB) LOS objects, 18% free, 72MB/88MB, paused 12.890ms total 146.342ms
07-17 14:00:18.928 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 355089(11MB) AllocSpace objects, 274(3MB) LOS objects, 9% free, 73MB/81MB, paused 15.859ms total 160.607ms
07-17 14:00:19.686 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 195600(6MB) AllocSpace objects, 141(2MB) LOS objects, 17% free, 74MB/90MB, paused 12.849ms total 178.069ms
07-17 14:00:21.182 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 355547(11MB) AllocSpace objects, 230(3MB) LOS objects, 9% free, 75MB/83MB, paused 15.525ms total 169.280ms
07-17 14:00:21.976 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 198615(6MB) AllocSpace objects, 125(2MB) LOS objects, 17% free, 76MB/92MB, paused 14.885ms total 189.052ms
07-17 14:00:23.256 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 47.205ms
07-17 14:00:23.381 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 341400(10MB) AllocSpace objects, 199(3MB) LOS objects, 9% free, 77MB/85MB, paused 22.363ms total 226.145ms
07-17 14:00:24.219 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 6.687ms
07-17 14:00:24.241 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 201712(6MB) AllocSpace objects, 114(2MB) LOS objects, 16% free, 78MB/94MB, paused 18.897ms total 231.284ms
07-17 14:00:25.640 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 362159(11MB) AllocSpace objects, 191(4MB) LOS objects, 9% free, 80MB/88MB, paused 18.455ms total 196.896ms
07-17 14:00:26.508 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 207054(6MB) AllocSpace objects, 105(2MB) LOS objects, 16% free, 80MB/96MB, paused 19.524ms total 242.993ms
07-17 14:00:27.740 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 20.809ms
07-17 14:00:27.938 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 359121(11MB) AllocSpace objects, 173(4MB) LOS objects, 8% free, 82MB/90MB, paused 22.227ms total 227.809ms
07-17 14:00:28.865 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 143.955ms
07-17 14:00:28.883 8830-8845/com.showcase.myapp W/art﹕ Suspending all threads took: 9.136ms
07-17 14:00:28.953 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 180135(5MB) AllocSpace objects, 89(2MB) LOS objects, 16% free, 82MB/98MB, paused 31.220ms total 285.652ms
07-17 14:00:30.535 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 358941(10MB) AllocSpace objects, 161(4MB) LOS objects, 8% free, 84MB/92MB, paused 23.857ms total 205.565ms
07-17 14:00:31.552 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 209000(6MB) AllocSpace objects, 92(2MB) LOS objects, 15% free, 84MB/100MB, paused 21.562ms total 296.594ms
07-17 14:00:31.557 8830-8845/com.showcase.myapp W/art﹕ Suspending all threads took: 5.546ms
07-17 14:00:33.183 8830-8845/com.showcase.myapp I/art﹕ Background sticky concurrent mark sweep GC freed 359858(11MB) AllocSpace objects, 151(4MB) LOS objects, 8% free, 86MB/94MB, paused 23.724ms total 235.404ms
07-17 14:00:34.243 8830-8840/com.showcase.myapp W/art﹕ Suspending all threads took: 8.744ms
07-17 14:00:34.264 8830-8845/com.showcase.myapp I/art﹕ Background partial concurrent mark sweep GC freed 222670(7MB) AllocSpace objects, 96(2MB) LOS objects, 15% free, 87MB/103MB, paused 24.276ms total 425.424ms
07-17 14:00:34.271 8830-8845/com.showcase.myapp W/art﹕ Suspending all threads took: 6.900ms
from hawk.
I have also see something weird...
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'byte[] com.orhanobut.hawk.Encoder.encode(java.lang.Object)' on a null object reference
at com.orhanobut.hawk.Hawk.zip(Hawk.java:225)
at com.orhanobut.hawk.Hawk.put(Hawk.java:177)
from hawk.
Another weird thing!!!!
E/dalvikvm﹕ Could not find class 'com.orhanobut.hawk.Hawk$2', referenced from method com.orhanobut.hawk.Hawk.putObservable
from hawk.
- Do you have a large set of stored data already?
- Did you use Hawk.putObservable() ?
from hawk.
- Yes i have a large set of stored data (about 8000 records)
- No i m not using Hawk.putObservable().
from hawk.
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.
from hawk.
Error:Could not find com.orhanobut:hawk:1.17.
from hawk.
I reupload the artifacts, apparently had some issues with maven central. It will be available in a few minutes
from hawk.
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.
from hawk.
Actually what i am doind is this.
- Hawk.init(this);
- Put on hawk a list of 8000 + records
- After that when i try: Hawk.put("test", true); <- freeze
- if i dont do the last step i am able to access that 8k records i have saved .
from hawk.
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?
from hawk.
I have called build
//Hawk.init(this).setStorage(HawkBuilder.newSqliteStorage(this)).build(); <- Thats how i did it.
from hawk.
and you still get the same error?
from hawk.
Yes, actually is not an error, the app is freezing and in the console i got the same "errors" i have posted you before.
from hawk.
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!
from hawk.
That's great news, just for info, you can also use transient keyword to avoid drawable to be serialized/deserialized
from hawk.
When i read from Hawk my 8k Objects the application seems to go in OOM, what i can do to avoid that?
from hawk.
I cannot think of any good solution for this problem unfortunately.
from hawk.
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.
from hawk.
Now i am adding those objects as pieces of 50. No OOM happens anymore.
from hawk.
Related Issues (20)
- why not use apply but commit?
- Is there a way to setup namespace of the keys? HOT 1
- java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
- Deserializing long as double
- error after changing setEncryption
- multiprocess
- can't find version 2.1.0 HOT 1
- Hawk isn't a 64-bit compliant library HOT 3
- Hawk V2.0.1, illegal type variable reference HOT 4
- The code base at tag (v.2.0.1) doesn't match with the corresponding gradle dependency
- What is the maximum value of stored data HOT 1
- Can you reload Hawk after init?
- Is this project dead? HOT 1
- Hawk getting error while debuggind HOT 1
- Hawk.put and Hawk.get issue
- DefaultHawkFacade.java line 98
- Classifier 'Hawk' does not have a companion object, and thus must be initialized here
- can't get data when overriding apps HOT 2
- ANR problem when init Hawk HOT 1
- Hawk.count() shows it has items but when use hawl.get(key, type) it gives only last or zero items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hawk.