View Full Version : doing too much in one frame? Memory issue?
starstutter
11-27-2008, 03:00 PM
So I'm running into a problem that seems to be connected to a "bad memory allocation". I can describe this in greater detail when I get time, but right now I want to ask a semi-generic question:
Can rendering the scene too many times cause an error? I'm not using different render targets and it doesn't seem to matter if I allocate or release memory. What is basicly happening is that if I render the scene too many times, the program crashes saying "The application requested the Runtime to terminate in an unusual way". Does this kind of thing happen if the video card runs out of memory?
So I'm running into a problem that seems to be connected to a "bad memory allocation". I can describe this in greater detail when I get time, but right now I want to ask a semi-generic question:
Can rendering the scene too many times cause an error? I'm not using different render targets and it doesn't seem to matter if I allocate or release memory. What is basicly happening is that if I render the scene too many times, the program crashes saying "The application requested the Runtime to terminate in an unusual way". Does this kind of thing happen if the video card runs out of memory?
So what happens if you run it with the debugger attached?
IF you are using DirectX what are the debug runtime error messages just before the crash?
starstutter
11-27-2008, 04:50 PM
Thanks for the quick reply.
So what happens if you run it with the debugger attached?
Nothing. Same message and it takes me to a place that tells me there's no source code available.
IF you are using DirectX what are the debug runtime error messages just before the crash?
I am using directX, but it doesn't say anything. Then again I don't really know how to use the DX debugger properly. -_-
Kenneth Gorking
11-28-2008, 01:27 AM
Nothing. Same message and it takes me to a place that tells me there's no source code available.Does the callstack trace back into your program, or is it thrashed? If it is not the ladder, that should atleast give you a hint to where it is going wrong.
What makes you think it is rendering relatet, btw?
I am using directX, but it doesn't say anything. Then again I don't really know how to use the DX debugger properly. -_-You need to fiddle with the 'debug level' slider in the DX Control Panel. Setting it to 3, will make it pump out detailed debug info.
Nothing. Same message and it takes me to a place that tells me there's no source code available.
Make sure the debugger halts as soon as an exception is thrown. Assuming Visual Studio, in the menu go to 'Debug' -> 'Exceptions...' and enable all checkboxes. Now the debugger will inform you as soon as the first exception is thrown, instead of waiting till there is an unhandled exception (causing the application to "terminate in an unusual way").
If there is no source code at the location of the crash, it can still be very interesting to take a look at the assembly code. Is it attempting to execute code at address 0x00000000? Is it reading or writing a null pointer, or 0xFEEEFEEE, 0xBAADF00D, or something alike?
A divide and conquer strategy should work as well. Systematically try doing less and less in one frame till it no longer crashes. Source control can also be of invaluable help. If the crashing only started recently try to find a revision that doesn't crash, and work from there.
Good luck!
Make sure the debugger halts as soon as an exception is thrown. Assuming Visual Studio, in the menu go to 'Debug' -> 'Exceptions...' and enable all checkboxes. Now the debugger will inform you as soon as the first exception is thrown, instead of waiting till there is an unhandled exception (causing the application to "terminate in an unusual way").
Thats a REALLY handy little trick.
Cheers :)
starstutter
11-28-2008, 09:40 AM
Ok, embarassing admission. I have no idea how to use the DX debugger, period. -_-
I've never really had to. Can someone point me toward an instruction manual? I found the debugger application, but I've looked on google for about half an hour and can't find how to get the actual debug messages...
EDIT: Woah, ok, I just did some digging around, and multiplying. Figured out I'm rendering the scene 160 times in a single 'for' loop. This is probably going to sound like an absurdley dumb question, but could THAT cause an error? It's all being done on the same render target.
(for those that are wondering, I'm rendering a grid of 20 SH representations with 8 directions, one scene render is required for each direction. Obviously this is a pre-process step. I know i can iterate just a few every frame untill the job is done, but I want to learn why this is happening.
Ok, embarassing admission. I have no idea how to use the DX debugger, period. -_-
I've never really had to. Can someone point me toward an instruction manual? I found the debugger application, but I've looked on google for about half an hour and can't find how to get the actual debug messages...
All you do is go into the directx control panel under directx sdk->utils on the start menu. select the direct3d tab and set the radio button to the debug libraries. DirectX will now spam out any errors into the debug output.
EDIT: Woah, ok, I just did some digging around, and multiplying. Figured out I'm rendering the scene 160 times in a single 'for' loop. This is probably going to sound like an absurdley dumb question, but could THAT cause an error? It's all being done on the same render target.
In a word .. no. Might cause things to run REALLY bloody slowly though ;)
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.