Android Question B4XWriteObject with huge map

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi to All. I have a huge map and when I try to save it with RandomAccesFile.WriteObject, my App crashes. with:

java.lang.OutOfMemoryError: Failed to allocate a 92274696 byte allocation with 49507712 free bytes and 47MB until OOM, target footprint 536870912, growth limit 536870912

I am wondering if it exists any official way to by pass this problem, or I have to invent a trick dividing the map in chunks.

Thanks for any hint.
 

Daestrum

Expert
Licensed User
Longtime User
it tells the java virtual machine how much memory it can use
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Anyway the solution is trivial: write each element in a loop, or make a custom bufferization. Nothing dramatic.
 
Upvote 1
Top