question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Out of memory when saving state

See original GitHub issue

Can’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:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
byenchocommented, Jan 10, 2020

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.

0reactions
byenchocommented, Dec 7, 2020

@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 calling parcel.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found