I have a server / client application where I get data from the server through Hessian / hessdroid. Data is very complex with HashMaps containing other HashMaps and images stored in byte arrays. I can display data perfectly.
To not always query the server, I use the data structure as a cache. I save this data object to the SD card using ObjectOutputStream when closing the application. When I reload it, I read it back into memory using ObjectInputStream.
I have problems with the application only after reading data from the SD card. LogCat gives me the following result (100 times):
DEBUG/dalvikvm(4150): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
and this between other posts:
INFO/dalvikvm-heap(4150): Grow heap (frag case) to 10.775MB for 281173-byte allocation
When the heap grows at ~ 17 MB, the application crashes.
I read a few threads about HashMap serialization and it seems to be a mistake when serializing between architectures, but for me data transfer through Hessian works fine, and I have the problems described only when reading HashMaps from disk.
Any ideas?
source
share