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
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10

Possible Memory leak using NavigationPane in Cascades

I recently returned from the BB Jam event in San Jose and am starting to delve deeper into BB10 development. When I run a sample 'NavigationPane' application on my device I notice that memory use increases as i push and pop a screen multiple times. The sample is coded in QML (No custom C++ components). While the increase is small it can add up over time.

 

Has anyone else noticed this behavior? I don't like shipping apps with memory leaks.

 

Here's a link to the code sample

 

Here's what the Memory Summary page shows:

Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: Possible Memory leak using NavigationPane in Cascades

If I remember correctly, it is your job to delete the page when it is popped from the navigationpane. So with this you are just creating more and more objects right? Or is it just pushing and popping the exact same object?

Like all of my posts
Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10

Re: Possible Memory leak using NavigationPane in Cascades

Hi Kyle,

 

In this case I've set the NavigationPane to destroy pages on 'pop' per some of the samples that I've seen. Here's the relevant code snippet:

 

import bb.cascades 1.0

NavigationPane {
id: nav

attachedObjects: ComponentDefinition {
id: highScoreScreen
source: "HighScoreScreen.qml"
}

// Transition is done destory the Page to free up memory.
onPopTransitionEnded: {
page.destroy();
}
}

 

Is there anything else that needs to be setup?

Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: Possible Memory leak using NavigationPane in Cascades

That should be all you have to do

Like all of my posts
Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10

Re: Possible Memory leak using NavigationPane in Cascades

Thanks for taking  a look. I've created an issue on the Issue tracker for this (In case anyone else is curious):

 

https://www.blackberry.com/jira/browse/BBTEN-301