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
Contributor
Posts: 26
Registered: ‎06-17-2013
My Device: Z10
My Carrier: Bell

What are counted as the 3MB memory limit that applies to the headless part of the app?

I am developing an app has headless service that needs to call cascades APIs.  By creating an empty headless project and adding CONFIG += cascades in the .pro file, the QNX system information perspective in the Momentics shows the service uses 2MB data.  It seems there is not much room to add customer functions for meeting the 3MB limit requirement.

 

And is there anybody know what kind of memory is counted for the 3MB limit?  Is it stack, heap, program data or library data, or any combination of those memory areas?

 

Thanks,

 

Tyler

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: What are counted as the 3MB memory limit that applies to the headless part of the app?

While the details on this haven't been published, based on a handful of different tidbits and experimentation it appears it's largely a limit on heap size.

It's not code (e.g. the TEXT segment, in libraries or your own code) but it may be that stack and what I think you're calling "library data" both count against it.

You can definitely observe the effect of this if you write a small test program which gradually malloc()s memory until it gets a NULL result. That will occur roughly where you've allocated 3MB of data. (I've been able to go slightly over, but perhaps that's just a little safety margin they added.)

Would be nice to have detailed docs on this of course, but chances are that the limit is not cast in stone and they're hoping for feedback from people. They may adjust the limit or how it's defined at some point, so perhaps detailed docs are considered premature still.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 26
Registered: ‎06-17-2013
My Device: Z10
My Carrier: Bell

Re: What are counted as the 3MB memory limit that applies to the headless part of the app?

Thanks Peter.

 

I hope they only count heap or in the worst case count stack as well when it comes to a final decision on this memory limitation.  The library data uses too much and user cannot do much with it.