Flint Particle System Forum - Garbage collection issue with PV3DParticleRenderer? Sat, 25 Dec 2010 19:36:45 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Garbage collection issue with PV3DParticleRenderer? http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=493#Comment_493 http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=493#Comment_493 Thu, 13 Nov 2008 18:20:27 +0000 mind
i took the fountain example from google code and changed the renderer from Pixelrenderer to PV3DParticleRenderer. I also have put a StatsView to see how it is going. FIrst everything seems to be normal, it makes 25 Fps or so. But memory usage gets constantly higher (it does drop sometimes a little but not back normal again) and after a while (some minutes) the Fps also drops down to 10 and even lower. It starts with using 7 MB and after a minutes its 30 MB and growing..

Any ideas?

Here is the code i am using:



package
{
import flash.display.Sprite;
import flash.events.Event;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.papervision3d.PV3DParticleRenderer;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.core.geom.Particles;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
import org.papervision3d.view.stats.StatsView;

[SWF(width='500', height='500', frameRate='61', backgroundColor='#000000')]

public class flintfountain extends Sprite
{
private var viewport:Viewport3D;
private var emitter:Emitter3D;
private var pv3dRenderer:BasicRenderEngine;
private var flintRenderer:PV3DParticleRenderer;
private var scene:Scene3D;
private var camera:Camera3D;

public var particles:Particles;

public function flintfountain()
{
viewport = new Viewport3D( 500, 500 );
addChild( viewport );
pv3dRenderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D();
camera.z = -300;

addChild(new StatsView(pv3dRenderer));
particles = new Particles();
scene.addChild(particles);
emitter = new Fountain();
emitter.position.y = -100;
flintRenderer = new PV3DParticleRenderer(particles );
flintRenderer.addEmitter( emitter );
emitter.start();
addEventListener( Event.ENTER_FRAME, render, false, 0, true );
}

private function render( ev:Event ):void
{
// render the view
pv3dRenderer.renderScene( scene, camera, viewport);
}
}
}

import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.threeD.actions.*;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.geom.Vector3D;
import org.flintparticles.threeD.initializers.*;
import org.flintparticles.threeD.zones.*;
import org.papervision3d.core.geom.renderables.Particle;
import org.flintparticles.threeD.papervision3d.initializers.PV3DObjectClass;
import org.flintparticles.threeD.papervision3d.initializers.ApplyMaterial;
import org.papervision3d.materials.special.ParticleMaterial;

class Fountain extends Emitter3D
{
public function Fountain()
{
counter = new Steady( 500 );
addInitializer( new PV3DObjectClass( Particle, null, 4 ) );
addInitializer( new ApplyMaterial( ParticleMaterial, 0x666666, 1, ParticleMaterial.SHAPE_CIRCLE ) );

addInitializer( new ColorInit( 0xFFCCCCFF, 0xFF6666FF ) );
addInitializer( new Velocity( new DiscZone( new Vector3D( 0, 250, 0 ), new Vector3D( 0, 1, 0 ), 60 ) ) );
addInitializer( new Lifetime( 3.2 ) );

addAction( new Move() );
addAction( new Accelerate( new Vector3D( 0, -150, 0 ) ) );
addAction( new Age() );
}
} ]]>
Garbage collection issue with PV3DParticleRenderer? http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=497#Comment_497 http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=497#Comment_497 Thu, 13 Nov 2008 22:21:33 +0000 Richard Garbage collection issue with PV3DParticleRenderer? http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=500#Comment_500 http://flintparticles.org/forum/comments.php?DiscussionID=122&Focus=500#Comment_500 Fri, 14 Nov 2008 13:39:12 +0000 mind sorry i did not think of that before.

btw great work with the whole library, respect.

Balazs ]]>