Warm starting and b2ContactID

From the info available around, i believe that b2ContactID is mostly used for warm starting.
Warm starting is concept of storing previous step information to be used in current step.
This is done to speed up collision resolution.
But this creates a lot of b2ContactID every step. Now this results in a lot of garbage every frame. As a result a lot of garbage gets stacked up after every few frames. This may make the physics faster but causes a jerk after every few frames.
How do i counter it.
I have turned off warm starting and so far things looked improved.
Still some b2ContactID objects are created every time. I think this is because of the general contact hiding. Is there any way i can remove or reduce the creation of lot of objects every frame.
I have done the same by reusing all objects created by me, but i still have some object creation/destruction. So i know it happens inside box2D. Even the memory profile confirms this.

Anything that can be done to counter this.

Also will absence of warm starting result into wrong physics. Or is it ok to have warm-starting turned off.
There aren't any more config options that'll help. Changing these things means going over the code and rewriting chunks to avoid allocations, incrementally improving the problem. This work is planned for some indefinitely future time. If contact ids are causing you a problem, you could start pooling those, like your user defined shapes.

Warm starting improves the quality of your simulation, but physics won't be "wrong" without it.
warm starting did give me problem with revolute joints.
It made them weaker than before.
Neways i have decide to stick with warm starting as it is not causing any considerable performance improvement.

I understand that the change that i have mentioned is rather big. But i think it should go well with flash.
I believe the current design is directly based on the C++ version (correct me if i am wrong). So dynamic allocation / deallocation of memory actually does not affect performance. Rather it brings down the total amount of memory required.
Because of the difference in GC mechanism of C++ and Flash, i think the design change is inevitable. I a not sure when some one would take it up, but i am sure everyone agrees that it has to be done sooner than later.

P.S. I am not very well versed with C# or Java, but i think they use a similar gc system as Flash. Can anyone from Java or C# comment on this.
Well, C++ has problems with dynamic allocations as well... if you just keep allocating and deallocating things at random, you'll thrash the heap and end up with heap fragmentation. To avoid this, and to provide a cleaner way of allocating and de-allocating memory, box2d provides its allocator class.

Flash could be made to be much more concious of memory thrashing I'll agree there. Since flash is GC'd, the current port just relies on that instead of creating a proper allocator/pool. In many places you'll actually see the allocation code commented out and the cleaning up left to flash's GC. I'm not complaining by the way. Just pointing it out. If I had more time, I would be working on it believe me.

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