Thread overview | |||||
---|---|---|---|---|---|
|
July 31, 2010 Debug OutOfMemoryError? | ||||
---|---|---|---|---|
| ||||
How do I debug an OutOfMemoryError? I'm trying to run a simple application that uses SDL and OpenGL with Derelict on Mac OS X 10.6. It works fine using D1 and Tango but fails with the message "Memory allocation failed" when I use D2. I probably messed something up when I ported the Mac specific parts of Derelict SDL to make it work with D2. But how do I debug it when it just prints "Memory allocation failed" and exits with code 01? I can't catch the exception and even if I could it would be useless because it doesn't contain any stack trace, what it looks like after looking at the druntime source code.
Any advise?
--
/Jacob Carlborg
|
August 02, 2010 Re: Debug OutOfMemoryError? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Sat, 31 Jul 2010 05:55:40 -0400, Jacob Carlborg <doob@me.com> wrote:
> How do I debug an OutOfMemoryError? I'm trying to run a simple application that uses SDL and OpenGL with Derelict on Mac OS X 10.6. It works fine using D1 and Tango but fails with the message "Memory allocation failed" when I use D2. I probably messed something up when I ported the Mac specific parts of Derelict SDL to make it work with D2. But how do I debug it when it just prints "Memory allocation failed" and exits with code 01? I can't catch the exception and even if I could it would be useless because it doesn't contain any stack trace, what it looks like after looking at the druntime source code.
>
> Any advise?
Try compiling druntime in debug mode with -gc, then debug the application, putting a breakpoint at the point where it prints the error.
-Steve
|
August 02, 2010 Re: Debug OutOfMemoryError? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On 2010-08-02 14:34, Steven Schveighoffer wrote: > On Sat, 31 Jul 2010 05:55:40 -0400, Jacob Carlborg <doob@me.com> wrote: > >> How do I debug an OutOfMemoryError? I'm trying to run a simple >> application that uses SDL and OpenGL with Derelict on Mac OS X 10.6. >> It works fine using D1 and Tango but fails with the message "Memory >> allocation failed" when I use D2. I probably messed something up when >> I ported the Mac specific parts of Derelict SDL to make it work with >> D2. But how do I debug it when it just prints "Memory allocation >> failed" and exits with code 01? I can't catch the exception and even >> if I could it would be useless because it doesn't contain any stack >> trace, what it looks like after looking at the druntime source code. >> >> Any advise? > > Try compiling druntime in debug mode with -gc, then debug the > application, putting a breakpoint at the point where it prints the error. > > -Steve I'll give that a try, thanks. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation