Solved

Unexplained crashes

Posted on 2004-08-24
5
181 Views
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?

Thanks

phoenix260182
0
Comment
Question by:phoenix260182
[X]
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
5 Comments
 
LVL 8

Expert Comment

by:pjcrooks2000
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
0
 

Author Comment

by:phoenix260182
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?
0
 

Author Comment

by:phoenix260182
ID: 11886207
Oh, and yes I'm using C++ in Visual Studio .NET 2003.
0
 
LVL 8

Expert Comment

by:pjcrooks2000
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 :)
0
 
LVL 11

Accepted Solution

by:
bcladd earned 50 total points
ID: 11913616
pheonix:

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,
-bcl
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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