memory fragmentation

Blitz3D Forums/Blitz3D Programming/memory fragmentation

Ross C(Posted 2003) [#1]
hey, in my particle system i am freeing and recreating lots of particles. will this lead to bad memory fragmentation. and if it does will the slowdown be that noticeable?
thanks


Ricky Smith(Posted 2003) [#2]
Not sure about memory fragmentation but the extra CPU cycles required to create and free lots of particles will lead to a noticible slowdown - how much depends on how many particles you are creating/freeing.
It will be faster to use a pool of a fixed number of particles and just cycle the EntityAlpha value and do a HideEntity when Alpha = 0.
To re-use the particle do a ShowEntity and set Alpha = 1.


Ross C(Posted 2003) [#3]
good idea and thanks for the response. if will cause computers to be unstable and slow then i'll just use the pool thing that you suggested. thanks :)