I've found this curious OutOfMemoryError, I wondered if anyone else had come across it. I am breaking the rules of SharedPreferences slightly and storing a couple of model objects as strings but these are small.
java.lang.OutOfMemoryError
at com.android.internal.util.FastXmlSerializer.(FastXmlSerializer.java:55)
at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:177)
at android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:596)
at android.app.SharedPreferencesImpl.access$800(SharedPreferencesImpl.java:52)
at android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:511)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
OOM errors can happen anywhere in the App.
It's just saying: hey, I tried to allocate something but I were out of memory. Sorry.
This can happen: you load a very big image in your app and are left with very few bytes available before OOM: you then have a simple parser allocating strings and stuff.. that can go OOM.
Your problem is elsewhere :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With