Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joycewang
Visitor

Scene Graph XML: quit app by home button freeze the device

Hi,

I'm new to Scene Graph XML, there's a problem in my current app, that when I quit app by back / home button, sometimes the device will freeze. I have added some solution to remove page components and unobserve interface field before quit. It helps a little when I quit app by back button, but the home button still makes device freeze.

Someone could me on this? Thanks in advance!
0 Kudos
24 REPLIES 24
joycewang
Visitor

Re: Scene Graph XML: quit app by home button freeze the devi

I'm still facing the same problem. Someone could help me?

It seems to me that the scene graph thread is not closing correctly. As I create a video node inside xml, and when I press home button to quit app, I can still hear the song playing even in Roku home page. What's a good way to release memory for scene graph xml?
0 Kudos
joycewang
Visitor

Re: Scene Graph XML: quit app by home button freeze the device

The problem is solved. I noticed there are many circular references in my app and they make troubles to release memory when app quit. After removing circular references, everything is charming.
0 Kudos
EnTerr
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

How strange. It shouldn't matter, the "orphaned objects (objects in a circular ref loop)" message is just a diagnostic, nothing bad with it.
Any particular thread that happens with? Or idea how many circ.refs?
0 Kudos
joetesta
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

Our SG app development is running into similar issues - pressing Home does not clear the memory. Often I can hear audio continuing indefinitely while staring at the Roku Home screen or even ater launching another app.
aspiring
0 Kudos
TheEndless
Channel Surfer

Re: Scene Graph XML: quit app by home button freeze the device

"joetesta" wrote:
Our SG app development is running into similar issues - pressing Home does not clear the memory. Often I can hear audio continuing indefinitely while staring at the Roku Home screen or even ater launching another app.

I ran into this same issue and tracked it down to having a reference to the video node in the global node.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
EnTerr
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

"TheEndless" wrote:
I ran into this same issue and tracked it down to having a reference to the video node in the global node.

What would be a working hypotenuse here... that the global Noid survives and persists past app exit?
0 Kudos
joetesta
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

"the global Noid survives and persists past app exit"

From experimentation done with "free" command on port 8080 it seems that this is the case (Global Node is not removed from memory by pressing Home button, or sideloading a new zip)
aspiring
0 Kudos
EnTerr
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

"joetesta" wrote:
From experimentation done with "free" command on port 8080 it seems that this is the case (Global Node is not removed from memory by pressing Home button, or sideloading a new zip)

How does "free" help you here, it just shows amount of free disk space, see https://forums.roku.com/viewtopic.php?f ... 30#p457961
0 Kudos
joetesta
Roku Guru

Re: Scene Graph XML: quit app by home button freeze the device

"free" shows the amount of memory consumed, not disk (i assume we don't need to discuss the difference). After exiting an app, the result of the "free" command should appear similar to the result before the app was launched. However, this is not the case with the SG app I'm trying to debug.

Unless you're saying Roku caches app data and persists that cache after app exit? The fact the box crashes implies it's running out of memory and the results from "free" seem to support that hypothesis. If we exit the app cleanly and delete everything while doing so (ie an "exit" feature in the app, not the Home button on remote) then "free" shows our memory has indeed been "freed"

App running: >free
total used free shared buffers cached
Mem: 379304 332052 47252 0 36084 155244
-/+ buffers/cache: 140724 238580
Swap: 0 0 0

App exited "cleanly">free
total used free shared buffers cached
Mem: 379304 266916 112388 0 36208 94540
-/+ buffers/cache: 136168 243136
Swap: 0 0 0

App running again>free
total used free shared buffers cached
Mem: 379304 358948 20356 0 36208 154240
-/+ buffers/cache: 168500 210804
Swap: 0 0 0

App exited with Home button>free
total used free shared buffers cached
Mem: 379304 353996 25308 0 36208 155788
-/+ buffers/cache: 162000 217304
Swap: 0 0 0
>

Far as I can tell, the only way to get that memory back is power cycling the roku 😕
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.