How do you handle OutOfMemoryError?

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 20 05:38:31 PDT 2015


On Sunday, 20 September 2015 at 00:16:50 UTC, Enjoys Math wrote:
> Here's my code:
>
> https://drive.google.com/file/d/0B3LYxKGJ4ZI_MV91SkxPVVlSOW8/view?usp=sharing
>
> I don't have access to a debugger.
>
> Run the code for a few minutes and it tends to crash with a 
> core OutOfMemoryError.
>
> Any suggestions welcome including regularly cleaning up memory 
> used.
>
> Thanks.

Memory allocated with the GC (e.g. using new) will never be freed 
if a reference is kept to it. Are you accidentally or 
deliberately keeping a complete history of all programs? Are you 
allocating any memory from anywhere other than the GC?

What OS? How much RAM? Are you compiling with -m32 (and 
conversely what happens if you compile with -m64)?


More information about the Digitalmars-d-learn mailing list