Memmory issues

Software: Away3D 3.x

Avatar
Darcey, Moderator
Posted: 17 August 2011 12:23 PM   Total Posts: 209

I have an application which has a 3D menu.

The 3D menu is comprised of:

Left small plane.
Left large plane.
Right large plane.
Right top small plane.
Right middle small plane.
Right bottom small plane.

For this I am loading in:

4 x 160x100 BitmapMaterials
2 x 500x320 BitmapMaterials

When clicked these materials switch to

5 x 1920x1080 BitmapMaterials
1 x 1920x1080 VideoMaterial


All this is in an ObjectContainer3D with everything having ownCanvas set to true.

The problem I have is when I null every variable, material, instance of anything this menu uses and remove all children in the objectcontainer3d.

The memory usage goes down a little but not all is released. At present the user can view 4 menus before the flash player crashes.

What’s the best way to dispose of BitmapMaterial and VideoMaterial.

I have nulled everything that can be nulled, removed all event listeners, converted all event listeners to weak references etc etc etc but still memory runs away.

Anyone got any insight on these issues?

Thanks

Darcey

   

Avatar
Darcey, Moderator
Posted: 17 August 2011 03:13 PM   Total Posts: 209   [ # 1 ]

Added the following to VideoMaterial.as and called with dispose helps quite considerably:

  // NOTE THIS IS NOT PART OF THE STANDARD AWAY3D 3.6 SVN / GIT
  public function dispose():void
  {
  try {
  _netStream.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
  } catch (e:Error) {}
 
  try {
  _netStream.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, ayncErrorHandler);
  } catch (e:Error) {}
 
  try {
  _netStream.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
  } catch (e:Error) {}
   
  try {
  nc.removeEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
  } catch (e:Error) {}
   
  try {
  nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);
  } catch (e:Error) {}
   
  _netStream.close();
  nc.close();
  nc = null;
  _text = null;
  _video.clear();
  _video = null;
  CustomClient = null; 
  }

   
   
‹‹ 3ds model

X

Away3D Forum

Member Login

Username

Password

Remember_me



X