Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 29
Registered: ‎02-24-2010
My Device: Not Specified
My Carrier: Vodafone

SQLite database throwing Exceptions: OutOfMemory and FileSystemError

[ Edited ]


I have some code that writes and retrieves data values from the database.

The database is being created on SDCard.

It is working fine with smaller values. But since I am dealing with JSON data coming from network, the data being inserted becomes Large (large enough to have ~8000 chars in a string).


Whenever data this large is being inserted in the SQLite database, it throws RuntimeException: OutOfMemory.

I have also observed that this Exception occurs when Statement.prepare() method is called.


I also get DatabaseIOException:File System Error (12) at times.

And the other times, I get ControlledAccessException.


Things are very annoying an instable right now which aren't letting me continue with my development.


When I try things out with another application, it also works fine with Small Data, but when i try to insert the same large data, I again get OutOfMemory exception.


I haven't defined any data-type of my table collumn and currently it has only two collumns: Name, Value.


What could be the problem?


are there any limitations with SQLite?


I am using Network Activity in a different thread than the UI one and when it finishes, it notifies my UI thread, can it be the problem anyhow?


the iPhone developers do it pretty well with their phones, and I am stuck with only this thing.


please assist!

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: SQLite database throwing Exceptions: OutOfMemory and FileSystemError

I would try to reproduce this problem using a simple, self contained Application program that generates random data and adds it your database as you are doing with your JSON data.  If you get the same error, report this as a bug to Issue Tracker.  If not, then you need to look at the differences between the sample program and your real program and try to figure out what you need to change. 


Just a thought.