Unexplained crashes

Posted on 2004-08-24
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
  • 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 

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 50 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

777 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