dispose obj Error #3600 now #3691

Software: Away3D 4.x

Sky, Newbie
Posted: 14 May 2012 08:04 AM   Total Posts: 16

hi,
I am trying to figure out if I misused dispose or it’s the away3d 4.0 bugs.

I got a few buttons and models in one scene. When I hit certain buttons, the program needs to “dispose” some models and load some other models.
My codes works great at the first few attempts, but when I am repeating the functions (disposes and loads), error came out:

Error: Error #3600: No valid program set.
at flash.display3D::Context3D/drawTriangles()

protected function unloadModel(_id:int):void
  {
   
if (!objArr[_id])
   
{
    trace
("mode does not load...");
    return;
   
}
   
if (objArr[_id].parent)
   
{
    objArr[_id]
.parent.removeChild(objArr[_id]);
   
}
   objArr[_id]
.dispose(true);
   
objArr[_id] undefined;
  

 

   

Sky, Newbie
Posted: 18 May 2012 01:27 AM   Total Posts: 16   [ # 1 ]

Hi, I’m still struggle with the error#3600 propbably casued by dispose obj or insuficient memory on the program. This is serious! cuz my total objs are less than 20MB.
I searched google with error3600 related posts. Error #3600 also happens when Plane.dispose(true).
https://github.com/away3d/away3d-core-fp11/issues/127

somebody suggested the memory management refactor. is there anyone know what “memory management refactor” means in here?

   

Avatar
Cheng Liao, Administrator
Posted: 18 May 2012 08:24 AM   Total Posts: 116   [ # 2 ]

Hi
  You are still using the alpha version.Please update to beta version.

   

Sky, Newbie
Posted: 24 May 2012 03:08 AM   Total Posts: 16   [ # 3 ]

Thanks to liaocheng, I’ve updated to beta version and been converting the codes.

New problem I didn’t have from Alpha version:
It’s OK if I load an obj then dispose it, but error happens when I am loading the 2nd obj.

Error: Error #3691: Resource limit for this resource type exceeded.

here’s how I load obj:

Obj = new Loader3D();
Obj.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
Obj.loadData(new O1(),null,null,new OBJParser(0.015)); 

here is definition of obj

[Embed(source="module/all.obj"mimeType="application/octet-stream")]
private var O1:Class; 

how I dispose the obj

for(var i:int 0;Obj.numChildren;i++)
{
 
var _mesh:Mesh Obj.getChildAt(i) as Mesh;
 
_mesh.dispose();
}
Obj
.dispose(); 

 

 

   

Avatar
Cheng Liao, Administrator
Posted: 24 May 2012 03:20 AM   Total Posts: 116   [ # 4 ]

Hi
You dosen’t dispose the materials.
The beta version require users to manager memory themself.
You can use this branch
https://github.com/away3d/away3d-core-fp11/tree/particlesfeature
This branch dosen’t require you to dispose anything.

   

Sky, Newbie
Posted: 24 May 2012 04:15 AM   Total Posts: 16   [ # 5 ]
liaocheng - 24 May 2012 03:20 AM

Hi
You dosen’t dispose the materials.
The beta version require users to manager memory themself.
You can use this branch
https://github.com/away3d/away3d-core-fp11/tree/particlesfeature
This branch dosen’t require you to dispose anything.

Thanks liaocheng. what you mean by “manage memory”?  I can’t figure it out here.

   

Avatar
Cheng Liao, Administrator
Posted: 24 May 2012 04:29 AM   Total Posts: 116   [ # 6 ]

Hi
“manager memory ” means if you create a object,then you must dispose it when you don’t use it no longer.In the beta version,the loader creates many objects but dosn’t dispose them.I suggest you use the particlesfeature branch.

   

Sky, Newbie
Posted: 25 May 2012 07:00 AM   Total Posts: 16   [ # 7 ]
liaocheng - 24 May 2012 04:29 AM

Hi
“manager memory ” means if you create a object,then you must dispose it when you don’t use it no longer.In the beta version,the loader creates many objects but dosn’t dispose them.I suggest you use the particlesfeature branch.

Thanks again. I read through your links, but I still couldn’t find any codes regarding managing memory from your particlesfeature branch. Mind to be more specific? very much appreciated.

   

Avatar
Cheng Liao, Administrator
Posted: 25 May 2012 07:43 AM   Total Posts: 116   [ # 8 ]

Hi
If you use this branch,you don’t need to call dispose any longer.These objests which are null-reference will be recycled by flash system.

   

Sky, Newbie
Posted: 25 May 2012 08:41 AM   Total Posts: 16   [ # 9 ]

thanks liaocheng, I just used particlesfeature branch
away3d-away3d-core-fp11-v4.0.0-beta-200-g88187f2.zip
but still having the same issue:

after I load the first object, I

this.scene.removeChild(Obj);
Obj null

then I add the 2nd obj. it’s good when loading 2nd obj, but error happens at

scene.addChild 
view3d.render() 

Error: Error #3691: Resource limit for this resource type exceeded.

when I first load either 1st obj or 2nd obj, they are OK.
but after that, it comes with error at loading either object again…

   

Avatar
Cheng Liao, Administrator
Posted: 25 May 2012 08:49 AM   Total Posts: 116   [ # 10 ]

Maybe your model has too many vertices.

   

Sky, Newbie
Posted: 25 May 2012 09:00 AM   Total Posts: 16   [ # 11 ]

thanks.

if the model has too many vertices, maybe the error should happen at the first time loading obj not the 2nd attempt.
In fact, it’s good when I first time loading either my objs. Any possible solutoins?

   

Avatar
Cheng Liao, Administrator
Posted: 25 May 2012 09:11 AM   Total Posts: 116   [ # 12 ]

You can open debug mode to find out which resource exceeds limited.

   

Sky, Newbie
Posted: 25 May 2012 10:18 AM   Total Posts: 16   [ # 13 ]

thx, I’ll give it a shot. Have a nice weekend!

   

Sky, Newbie
Posted: 28 May 2012 09:12 AM   Total Posts: 16   [ # 14 ]

Spent almost a day to replace simplier models and tried the debug. Really, no helps at all!

I really wonder if it’s me or what exactly the solution for #3600/3691. I guess my part I’ve tried all I can and spent many weeks developing it.
It’s a very disappointing development. Hope away3d all the best and be better in the future.

Thanks to liaocheng and fellows replied this posts. enjoy it!

   

Sky, Newbie
Posted: 28 May 2012 10:45 AM   Total Posts: 16   [ # 15 ]
begin load mode/security_pavilion.obj...
load ok...
[OpCode name="mov"numRegister=2emitCode=0flags=0]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[Register name
="va"longName="vertex attribute"emitCode=0range=7flags=66]
[OpCode name
="m44"numRegister=3emitCode=24flags=16]
[Register name
="op"longName="vertex output"emitCode=3range=0flags=65]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[Register name
="vc"longName="vertex constant"emitCode=1range=127flags=66]
[OpCode name
="mov"numRegister=2emitCode=0flags=0]
[Register name
="v"longName="varying"emitCode=4range=7flags=99]
[Register name
="va"longName="vertex attribute"emitCode=0range=7flags=66]
[OpCode name
="m34"numRegister=3emitCode=25flags=16]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[Register name
="vc"longName="vertex constant"emitCode=1range=127flags=66]
[OpCode name
="mov"numRegister=2emitCode=0flags=0]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
[OpCode name
="sub"numRegister=3emitCode=2flags=0]
[Register name
="v"longName="varying"emitCode=4range=7flags=99]
[Register name
="vc"longName="vertex constant"emitCode=1range=127flags=66]
[Register name
="vt"longName="vertex temporary"emitCode=2range=7flags=67]
null
generated bytecode
:
 
a0010000 00a10000 00000000 000f0200
 0000e400 00000000 00000000 
00000018
 
00000000 000f0300 0000e402 00000000
 0000e401 00000000 00000000 000f0401
 0000e400 00000000 00000000 
00000019
 
00000001 00070200 0000e402 00000004
 0000e401 00000000 00000001 
00080200
 
0000ff02 00000000 00000000 00000002
 00000001 000f0408 0000e401 00000001
 0000e402 000000
[OpCode name
="nrm"numRegister=2emitCode=14flags=0]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="v"longName="varying"emitCode=4range=7flags=99]
[OpCode name
="mov"numRegister=2emitCode=0flags=0]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="v"longName="varying"emitCode=4range=7flags=99]
[OpCode name
="mov"numRegister=2emitCode=0flags=0]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="fc"longName="fragment constant"emitCode=1range=27flags=34]
[OpCode name
="tex"numRegister=3emitCode=40flags=40]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="v"longName="varying"emitCode=4range=7flags=99]
[Register name
="fs"longName="texture sampler"emitCode=5range=7flags=34]
[OpCode name
="div"numRegister=3emitCode=4flags=0]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
[OpCode name
="mov"numRegister=2emitCode=0flags=0]
[Register name
="oc"longName="fragment output"emitCode=3range=0flags=33]
[Register name
="ft"longName="fragment temporary"emitCode=2range=7flags=35]
null
generated bytecode
:
 
a0010000 00a1010e 00000000 00070201
 0000a404 00000000 00000000 00000000
 00000000 
00080201 0000ff04 00000000
 00000000 00000000 00000001 000f0200
 0000e401 00000000 00000000 
00000028
 
00000001 000f0200 0000e404 00000000
 00000005 00001204 00000001 00070201
 0000a402 00000001 0000ff02 00000000
 00000000 000f0301 0000e402 00000000
 00000000 000000
error
ErrorError #3600: No valid program set. 


last message from debug. not sure what I am reading here.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X