Faisal Abid
Faisal Abid

Reputation: 9140

Caching large Arrays to SQLite - Java/ Android

Im currently developing a system where the user will end up having large arrays( using android). However the JVM memory is at risk of running out, so in order to prevent this I was thinking of creating a temporary database and store the data in there. However, one of the concerns that comes to me is the SDcard limited by read and write. Also another problem that comes to mind is the overhead of such an operation. Can anyone clear up my concerns, as well as also suggest a possibly good alternative to handling large arrays ( in the end these arrays will be uploaded to a website by writing a csv file and uploading it).

Thanks, Faisal

Upvotes: 3

Views: 1576

Answers (1)

aperkins
aperkins

Reputation: 13114

A couple of thoughts:

  1. You could store them using a dbms like Derby, which is built into many versions of java
  2. You could store them in a compressed output stream that writes to bytes - this would work especially well if the data is easily compressed, i.e. regularly repeating numbers, text, etc
  3. You could upload portions of the arrays at a time, i.e. as you generate them, begin uploading pieces of the data up to the servers in chunks

Upvotes: 3

Related Questions