Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box2DX Generates Garbage While Running #9

Open
GoogleCodeExporter opened this issue Feb 6, 2016 · 0 comments
Open

Box2DX Generates Garbage While Running #9

GoogleCodeExporter opened this issue Feb 6, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Run any non-trivial TestBed scenario (E.g. Pyramid) under the CLR 
Profiler (See http://msdn.microsoft.com/en-us/library/ms979205.aspx for 
details on running the CLR Profiler).
2. Examine the Timeline for an interval during which the test is running 
normally.

What is the expected output? What do you see instead?
I would expect to see a steep curve that gradually levels out indicating 
that Box2DX is reusing objects through pooling.

I see a sawtooth pattern indicating an allocate/collect cycle is occuring.  
Examining the types of objects allocated shows that Box2DX objects, such as 
Vec2 [], ManifoldPoint, Position [] etc., are being allocated and released 
with each step.  In a simple scenario in my game Box2DX is allocating 
around 200k per second which will trigger a garbage collection and 
consequently a small drop in framerate every 5 seconds or so.

What version of the product are you using? On what operating system?
SVN Revision 56 (6/11/2008).  Development Platform: Windows XP.  Target 
Platforms: XNA on PC and XBox.

Please provide any additional information below.
The problem is that when the garbage collector runs for XNA games on the 
xbox there is a perceivable jerk in the framerate.  In order for Box2DX to 
work well on this platform there needs to be at least a compile option to 
use pooled memory rather than garbage collected memory.

Great work on box2dx so far.  I understand if this issue isn't important 
for you and you don't want to complicate the code.  I'll probably be making 
the changes for my own project anyway.  I'd be willing to help with this or 
other parts of box2dx if you need.

- Dale


Original issue reported on code.google.com by dale.fr...@gmail.com on 31 Dec 2008 at 8:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant