Welcome!

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

Native Development

Reply
Developer
Posts: 76
Registered: ‎02-08-2013
My Device: z10
My Carrier: rogers
Accepted Solution

Headless And SQL

The tight memory constraints for headless apps is difficult to contend with. My sql queries seem to fail without of memory errors whenever there is a 'WHERE x = y' in the query.

 

Something like this

SELECT date, description, stuff from calendar 

Works fine and memory usage seems reasonable although non-deterministic.

 

But this:

SELECT date, description from calendar WHERE date = x

Fails frequently with 'out of memory' errors. I can also see from the QNX system information perspective in the IDE that the memory is suddenly peaking near 3MB in the later query.  My table has no more than 10 000 records in it.

 

The question is, why does refining a query further consume more memory? My objective was to limit memory use and I inadverdantly blew the limit in doing so. How can I perform a very specific query but keep memory use low?

 

Also, will Blackberry revise the memory limits? The two major tools I intended on using  (QNetwork and QTSql) and highly non-deterministic in their memory consumption and would cause too much instability to be useful in a headless app.

 

Thanks.

 

Developer
Posts: 76
Registered: ‎02-08-2013
My Device: z10
My Carrier: rogers

Re: Headless And SQL

The ultimate solution was simply to ask the blackberry headless team for more headless heap memory. In my case QtSql and QtNetwork always seemed to end up consuming a variable amount of memory often leading to hitting the memory ceiling. The solution to QtNetwork's memory consumption issues was to switch to libcurl which has ended up being an overall better solution, it certainly consumes less memory in a more predictable manner. I can't find any way around using QtSql though, it'd be nice to hear if anyone knows of a light weight sqlite library for bb10. Or at least a way of limiting QtSql's heap utilization.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Headless And SQL

Are you saying you asked and got a raise in the limit from BlackBerry, I thought this was imposed at the OS level?

 

I'm sure others will be interested in your response.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Headless And SQL


BBSJdev wrote:

Are you saying you asked and got a raise in the limit from BlackBerry, I thought this was imposed at the OS level?

 

I'm sure others will be interested in your response.


Well, it is not openly talked about by BlackBerry...

The memory limitations are managed via the signing key, they can add permissions to your signing key that allow your app to consume more memory.

I gave Enaud a small hint in this direction, but afaik there is no official way to request that, so maybe you ask him who he talked to.

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 222
Registered: ‎10-19-2012
My Device: Playbook, BB10DevAlphaB/C, Z10
My Carrier: Sonera, Saunalahti

Re: Headless And SQL

Why not just use sqlite library directly ?


Kaj-Michael Lang, Home.
Author of: Onki and RetroPlayer
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Headless And SQL

Thanks Simon, was just interested as I didn't know this, not needed for myself at this point but good to know. Smiley Happy

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
Developer
Posts: 76
Registered: ‎02-08-2013
My Device: z10
My Carrier: rogers

Re: Headless And SQL

It's imposed via the debug token, after my request a new 'property' was assigned to the debug token (I had to generate a new one) from the Blackberry side. I learned that you can request a higher memory limit from a forum dicsussion that I can no longer find.