Away3D Gold + Starling 1.1 : memory issue on iPad?

Software: Away3D 4.x

Abracad, Newbie
Posted: 24 July 2012 09:16 AM   Total Posts: 17

Hi all,

I’ve got the very same code with an UI handle by starling and a skybox by away3d.
One of it, based on the starling + away dev branch (dedicated to have them work together), is working fine.
The other one, based on starling and away3d gold offical’s releases, crash on an iPad 1.
The only difference in the code is the way starling and away are initiated and the way they are rendered during the onEnterFrame loop.
I can see the first (and sometime second) face of the skybox displayed before it crash so, up to this point, there is no bug.

Are there any known differences between those 2 versions concerning memory managment?
I’m targeting memory because the ipad 1 is very limitated on this point and is a kind of ‘perfect test platform’. Both versions of the code works well on an iPad 2.

   

Richard Olsson, Administrator
Posted: 24 July 2012 11:31 AM   Total Posts: 1192   [ # 1 ]

Are you talking about an unmodified version of the dev branch from the away3d-core-fp11 repository on GitHub? If so, the code in that branch should be almost identical to what’s in master (the gold release.) In fact, I just did a diff now and there are very few differences at this point.

Can you try to run in debug mode or in any other way figure out where exactly it’s crashing?

 

   

Abracad, Newbie
Posted: 24 July 2012 01:52 PM   Total Posts: 17   [ # 2 ]

Yes, an unmodified version of the dev branch on GitHub that was there 15 days ago.

I went back to the official’s releases to trace every step of the code and today i can see the skybox displayed about 1 time on 3 lauch. The 2 others crash (which never append with the dev branch).
It always crash while loading the bitmap for the 6 faces, sometimes after the first one, sometimes after the 2nd one… at anytime in fact.
It still never crash on an iPad 2.

 

   

Richard Olsson, Administrator
Posted: 24 July 2012 01:58 PM   Total Posts: 1192   [ # 3 ]

Thanks for clarifying. Fifteen days ago the code in the dev branch was very old, since we were then doing most of our work in the release branch to prepare for the 4.0 release.

I’m afraid it’s really hard to debug this issue unless you can provide some more information about when it crashes (in the code) exactly. Can you not run your AIR app in debug mode to get the call stack traced?

 

   

Abracad, Newbie
Posted: 24 July 2012 03:44 PM   Total Posts: 17   [ # 4 ]

here is the function that is called when a file (jpg) has been loaded successfully (i dit not clean it):

private function onFichierComplete(e:ArkaPlayerEvent):void {
   _nbImgLoaded 
+= 1;
   
//
   
trace("VrPlayer, onFichierComplete : " e.data.src);
   
//
   
var sbm:SkyBoxMaterial _skyBox.material as SkyBoxMaterial;
   
trace("VrPlayer, onFichierComplete : sbm");
   var 
bct:BitmapCubeTexture sbm.cubeMap as BitmapCubeTexture;
   
trace("VrPlayer, onFichierComplete : bct");
   
//
   
var ref:String e.data.src.substr(e.data.src.length 62);
   switch( 
ref ){
    
case "_r" :{
     bct
.positiveX e.data.donnee;
     break;
    
}
    
case "_l" :{
     bct
.negativeX e.data.donnee;
     break;
    
}
    
case "_u" :{
     bct
.positiveY e.data.donnee;
     break;
    
}
    
case "_d" :{
     bct
.negativeY e.data.donnee;
     break;
    
}
    
    
case "_f" {
     bct
.positiveZ e.data.donnee;
     break;
    
}
    
case "_b" :{
     bct
.negativeZ e.data.donnee;      
     break;
    
}
   }
   trace
("VrPlayer, onFichierComplete :bct.positive/negative set");
   
//
   
if (_nbImgLoaded == 1{    
    _v3d 
AppliRoot.away;
    
//    
    
_camControler = new HoverDragController(_v3d.camera_v3d.stagethis);
    
_camControler.tiltMin = -45;
    
_camControler.tiltMax 45;
    
//
    
_v3d.scene.addChild(_skyBox);
    
//    
    
EventManager.dispatchEvent(new ArkaPlayerEvent(ArkaPlayerEvent.PLAYER_READY));
    
trace("VrPlayer, onFichierComplete : ArkaPlayerEvent.PLAYER_READY");
    
_tl.load("media/"+_xml.@src+"/panorama"+_lstSufixe[1]+".jpg",false);
   
}else if (_nbImgLoaded == _lstSufixe.length{
    EventManager
.removeEventListener(ArkaPlayerEvent.FICHIER_COMPLETonFichierComplete);
    
EventManager.dispatchEvent(new ArkaPlayerEvent(ArkaPlayerEvent.PLAYER_COMPLETE));
    
trace("VrPlayer, onFichierComplete : ArkaPlayerEvent.PLAYER_COMPLETE");
   
}else {
    trace
("VrPlayer, onFichierComplete : now loading panorama" _lstSufixe[_nbImgLoaded]);
    
_tl.load("media/"+_xml.@src+"/panorama"+_lstSufixe[_nbImgLoaded]+".jpg",false);
   
}
   
  } 

and as an attachments the traces of 2 sessions in fdb. As you can see it’s not always crashing at the same time and it sometime doesn’t crash.

 

   

Richard Olsson, Administrator
Posted: 24 July 2012 03:50 PM   Total Posts: 1192   [ # 5 ]

So when it’s crashing there are no ActionScript errors being thrown?

Have you done any debugging in terms of trying to turn features off or minimize your use-case to figure out what exactly it is that causes it to crash? Have you tried running only starling or only the Away3D part of your app?

There are no known issues like this, so we can’t provide any help unless you do the hands-on debugging yourself and tell us your results.

 

   

Abracad, Newbie
Posted: 24 July 2012 04:05 PM   Total Posts: 17   [ # 6 ]

Thank you for your time Richard.

You’re right, no AS3 errors (same code never crash with the dev branch).

I haven’t got time to do what you are suggesting for the moment so i’m going to stay with the dev branch as far as i can. I will go back to that problem later and won’t forget to let you know the result.

Thanks again.

 

   

Richard Olsson, Administrator
Posted: 24 July 2012 04:08 PM   Total Posts: 1192   [ # 7 ]

If it just crashes, without letting the AVM know about it, that’s most definitely a bug in AIR. AIR should never crash, because it is a runtime and anything that the client code does should at most result in a halted state.

It would be important both for us and (probably) for Adobe to know what it is that you’re doing that causing it to crash, so we can find the best possible way to prevent that from happening.

Please consider trying to find the time at some point to debug this more thoroughly as a way of contributing to the Away3D engine and the AIR runtime. Thanks!

 

   

Abracad, Newbie
Posted: 24 July 2012 04:32 PM   Total Posts: 17   [ # 8 ]

i’m producing app for ios with air for about one year now and i went through many problem on the iPad 1 after the release of ios 5 and the launch of iCloud.
There is so little free memory on this platform that apps that where used to work fine where crashing after updating to ios 5 (same with 5.1).
If you install a memory tracker on this device you can see think like 10Mo free when nothing is launch and 110Mo free after launching the Photos app, for example…

I’m about 100% sure that when it crash like that (with no bug in the code) it is due to a kind of memory overflow. I would not say that it comes from air. I would rather think that either Starling 1.1 or Away Gold (both official) are using a bit more memory in the way they are instanciated now than it was with the dev branch.

 

   

Richard Olsson, Administrator
Posted: 24 July 2012 04:38 PM   Total Posts: 1192   [ # 9 ]

I’m not saying that the crash is caused by AIR, or couldn’t be prevented without changes to the AIR runtime. I am however saying that AIR should never crash like that. If there is something wrong with the code that runs in AIR (i.e. ActionScript) then the runtime should report that error. That’s the purpose of a runtime.

I can only ask you to try and disable features to try and figure out what exactly causes the application to go over the top and crash. If you can’t do that, e.g. if you don’t have time, then I understand and there is little we can do to try to resolve this issue.

 

   

Abracad, Newbie
Posted: 24 July 2012 05:23 PM   Total Posts: 17   [ # 10 ]

I’m going to do a very basic app with a starling button launching a skybox and test it with both the official and the dev branch of starling + away. (i won’t have time tomorrow so maybe thursday or friday).

 

   

Abracad, Newbie
Posted: 26 July 2012 08:55 AM   Total Posts: 17   [ # 11 ]

It’ done.

With the away3d Gold + starling 1.1 i can, most of the time, see the skybox fully loaded and it always crash if i try to add a second one. In a few case it crash at first loading.

With away3d dev + starling dev i can always see the first skybox and in a few case load a second one. In that case it crashes on third try.

I agree with you Richard, it would be great if air would allow to catch the error.
What if it’s ios that is closing the app? Is it possible and, in that case, would it let air know that it’s about to be closed?

I think this kind of crash can simply be reproduce without away and starling just by loading and add to stage the same bitmap again and again till no free memory is left. I will try it…

 

   

Abracad, Newbie
Posted: 27 July 2012 02:57 PM   Total Posts: 17   [ # 12 ]

I get rid of the crash by no more updating BitmapCubeTexture’s bitmapData as they go along. I’m building the skybox when all the 6 textures used are downloaded and it’s working fine. I’m ok with it.
The fact of being able to display the first face asap is important when downloading the ressouces over the internet but was a wrong idea on the ipad for at least 2 reasons :
- It does crash frequently (i’ve found tons of “low-memory” repports in the ios crash log folder)
- It takes between 5 to 6 seconds to update the bitmapData of 1 face of the BitmapCubeTexture (1024x1024px). All included my skybox needed about 30 seconds to display. Now it takes arround 6s, which is much more acceptable.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X