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

Possible memory leak / garbage collection issue #3

Open
Cyral opened this issue Jul 13, 2013 · 2 comments
Open

Possible memory leak / garbage collection issue #3

Cyral opened this issue Jul 13, 2013 · 2 comments

Comments

@Cyral
Copy link

Cyral commented Jul 13, 2013

I noticed In my game, every few seconds there was a little lag spike. I first investigated the GC by making a label that displays

    "GC: " + GC.GetTotalMemory(false);    

I could see it rising and falling very quickly, leading me to believe there is a GC issue. I tested neoforce controls the same way and found that it does the same thing.

Could it be possible there is a bug where objects are being created to fast or not being disposed?

@Grimston
Copy link
Contributor

XNA has leaks on its own, and its quite normal for little lag spikes, due to the way XNA does its updating loop. It becomes less apparent as your game becomes larger.

Are you getting the same issue with the Central Application?

@Cyral
Copy link
Author

Cyral commented Jul 19, 2013

Even with a quite large game I have, it is noticeable. I did a little experiment today using the XNA Platformer starter kit, without neoforce GC.GetTotalMemory(false) would start at about 3,900,000 and start climbing, very, very slowly. With Neoforce it started around the 4-5m range, although I would expect that since it obviously needs more memory, however, the memory then goes skyrocketing to 8m, and repeats as soon as the GC is collected.

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

No branches or pull requests

2 participants