I've had something similar happen, yebblies explained it best: http://d.puremagic.com/issues/show_bug.cgi?id=6821
For that issue it was: "Currently attempting to allocate during a garbage collection throws an oom error. This is due to limitations in the current gc implementation, previously it just corrupted memory. As the Foo object is only destroyed when the final collection occurs, the assert failing in the destructor tries to allocate an AssertError and fails." You should use core.stdc.stdlib.malloc if you want to use the C runtime and manage memory manually, not GC.malloc which uses the garbage collector. IOW: import std.stdio; import core.stdc.stdlib; class ExternalMemoryHandle { void *p; this() { p = malloc(1024); } ~this() { free(p); } } void main() { auto test = new ExternalMemoryHandle(); writeln("exiting"); } Otherwise if you want to use the GC there's no point in calling GC.free in the destructor since the GC will do that automatically.