Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Unexplained crashes

Posted on 2004-08-24
Medium Priority
Last Modified: 2010-04-07
I am writing a DirectDraw game. I had a few memory issues, which I seem to have fixed using windows task-manager to find where things were going wrong. After watching the app running for some time, the memory usage doesn't seem to change.

My problem is that when I run my game on another machine to my own, it runs fine for some time, but after a while just dies. Windows doesn't give me any error messages, and as I said the memory usage doesn't seem to change, so I have no clue as to what is going on.

Does anyone have any ideas as to what is going on, or what I could do to find out?


Question by:phoenix260182
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 11885753
I take it tha your creating your game in C++, make sure you have created destructors for all your functions.

Otherwise you may be experiencing memory leaks and this will cause a crash.  

This may help you http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21010102.html 

good luck pjcrooks2000

Author Comment

ID: 11886194
Okay, I am finally getting some error messages. One of them mentions something about a call to a function. The function's name has something to do with the heap pointer. Helpful at all?

Author Comment

ID: 11886207
Oh, and yes I'm using C++ in Visual Studio .NET 2003.

Expert Comment

ID: 11886486
Yes it does sound like a problem with a call to a destructor, heap = adding to stack.  Try running debug and see where the problem comes in at from the compiler.   Possibly the F5 key I am not sure but you can get to it through the menu anyway.

Step through the program and it should stop at the point where you program fails at.

I had something not too long ago with a Tile Map game I was making, I am not sure I can help you too much more on that unless you can copy and paste the offending code in here.  But run debug to find it, you never know it may be obvious to you once you get there.

Good luck with that :)
LVL 11

Accepted Solution

bcladd earned 200 total points
ID: 11913616

The heap is where dynamic memory is allocated (new in C++). It is not enough to have destructors for every object. You also have to make sure that your destructors release any resources held by the object in question (every new MUST be paired with a delete). You also have to make sure that you release any Direct* resources that you get (they are reference counted and until all refereces are released they are not cleaned up).

I agree that the debugger is your friend if you can reproduce the error. Is there anything you can do to make it happen faster on the other machine? What are the differences between the two configurations? If you can repro the bug on a development machine, then you can (hopefully) runn the program under the VS debugger and get a postmortem (it will show where the program was when it crashed). Unfortunately, it will, most likely, be right after a call to new that has nothing to do with the problem (it is just where the memory problem was detected).

Good luck,

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question