Jump to content
  • Advertisement
Sign in to follow this  
zike22

Memory problem??

This topic is 4820 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The game I've been programming compiles fine but sometimes freezes when I run it. I then get the message that I'm running low on memory and that windows wants to increase the size of my virtual memory. Now I seriously doubt that my (not even at demo stage) game requires that much horsepower. My laptop has slighty above avrage gaming specs, I dont notcie the problem on my desktop (which has better specs then my laptop). So I'm thinking theres some type of memory leak or something, this happen to anyone else?? Any suggestions, tips, or ideas?? Thanks

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you have an infinite loop that is allocating memory, or a recursive function that never stops. What happens when you step through the code in the debugger?

Share this post


Link to post
Share on other sites
"step through the code in the debugger?". I'm not really sure what you mean by that. When I compile I tons of errors about printing text to the screen for some reason. I dindt get them before but when I updated Allegro i started receving them, but the program compiles just fine w/ the exception of those errors

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
are you using windows? if so you can add this to the start of your program...

_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );

this will track your memory allocations and report all memory that was not released when your program exits. If you use visual studio, run your program in the debugger (f5) and then exit your program normally. All the leaks will print out in the output window with allocation numbers next to them.

You can then use CrtSetBreakAlloc( allocNumber ); to have visual studio break when that part of memory is allocated.

Doing this and cleaning up all your memory leaks will probably also help you clean up runtime leaks that are continually building up.

hope that was some help to you

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!