Box2D Slowdown!

Hello box2d community, I hope you're well 🙂


I am trying to use Box2D to visualise the movements of a large number of particles, except that if I increase considerably the number of particles, a major slowdown occurs.

I already tried the grabage collection, but nothing has changed because I will not destroy / remove my particles.



Here is a little video I made that explains my problem well:

http://www.youtube.com/watch?v=MtQY2gVf ... r_embedded


and so I was wondering if there's a solution.
for example can we increase the memory allocated (req memory) to flash as I have a i7 pc and 8gb of ram?


or is there a way to make a kind of loading that loads in prior the movements of particles?

if anyone has a propostion I'm takers.
a solution I'll marry him/her 😁

thank you in advance and sorry for my bad english
I think this is a known issue with Box2D AS3 2.1a, where over 500 bodies will cause a lot of lag (not caused by graphic rendering, but pure Box2D processing). Box2D AS3 2.1a, since it's in alpha (and hasn't been touched for a long time), it doesn't have a lot of optimizations that would make Flash run Box2D more efficiently. So, Box2D AS3 2.1a at its current state is probably not the best port to simulate particles. You can try the WCK/Alchemy port (which is also Flash).

As for increasing memory allocated for Flash, I believe Flash allocates more memory on a when-needed basis, and there is no limit (the only limitation is essentially the amount of RAM the user has). Flash will keep using up more memory when it's needed. In other words, it only increases the memory allocated when Flash needs it. So you have a lot of potential memory, and increasing the memory allocated will only occur if Flash needs it. Besides, simply increasing the allocated memory isn't going to solve the slowdown issue.
thank you Jayther for your rapid answer.

In fact, I already tried WCK / Alchemy Port and unfortunatly, it gets even more heavier.

So, if I have understand correctly, there's no way to solve the problem of slowing down.

if it is the case, do you know a good particle engine in Flash(AS3) that take in considration the collision?

Original thread: https://box2d.org/forum/viewtopic.php?t=8340