Out of memory when saving state
See original GitHub issueCan’t really replicate this issue, but reported quite a bit of instance error log
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 9740048 byte allocation with 7449136 free bytes and 7MB until OOM
at java.lang.StringFactory.newStringFromChars + 218(StringFactory.java:218)
at java.lang.StringFactory.newStringFromBytes + 203(StringFactory.java:203)
at java.lang.StringFactory.newStringFromBytes + 63(StringFactory.java:63)
at android.util.Base64.encodeToString + 456(Base64.java:456)
at com.livefront.bridge.BridgeDelegate.writeToDisk + 171(BridgeDelegate.java:171)
at com.livefront.bridge.BridgeDelegate.saveInstanceState + 164(BridgeDelegate.java:164)
at com.livefront.bridge.Bridge.saveInstanceState + 80(Bridge.java:80)
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
save state out of memory
When I try to save state, it gives the error out of memory, trying to allocate 4xxxxxx byte memory. How can I fix...
Read more >"Oh noes, Out of Memory" : r/PCSX2 - Reddit
Suddenly started getting it yesterday in Okami, which closed the emulator and removed the current save state too. I was using the 8th...
Read more >Resolve Out Of Memory Issues - SQL Server - Microsoft Learn
Learn about out-of-memory situations in SQL Server In-Memory OLTP, how to restore and resolve impacts, resolve page allocation failures, ...
Read more >The save failed due to out of memory or disk space
The save failed due to out of memory or disk space. I have a MacBook Pro and ran into this error message after...
Read more >CUDA Out of memory error during checkpoint saving ... - GitHub
Hey, I believe this is because of the consolidation of sharded optimizer states. When Lightning saves a checkpiont, it consolidates the state ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @elye . Thanks for investigating that! Yes that is pretty much the exact approach I had in mind when I mentioned using
File
/FileOutputStream
as a larger change to get around the issue. This is definitely something I want to pursue further. I’d say for now it looks like you can just go ahead and use your own fork until I can get around to getting a version of this change into the main library.@elye The fix to avoid Base64-encoding the data to get around the OOM issue has been released with
v1.3.0
. Sorry for the delay on this! Please let me now know if you have more questions. I’m going to close the issue for now. As for the OOM problem when callingparcel.writeBundle(bundle)
, the best I would be able to do is catch the exception and fail to save the state. If that’s a fix you’d be interested in, feel free to open a separate issue for that and I can look into it.