Heap limits?

I'm wondering if I'm reaching the limits of how many times I can use the "new" keyword or heap size.

Upon initialization, I am creating a ton of objects. I am getting a crash in a line that shows this:
SomeStruct* someStruct = new SomeStruct();

It's really just a structure so I don't know how it could crash here. It runs when I run this inside of visual studio's debugger, but crashes if I run the binary from Win7. I understand that VSC++ DEBUG mode is more forgiving on dynamic memory so what kind of issues should I expect to troubleshoot here?

Note that there is no crash message from Windows.
Are you using a delete for every time you use the new operator?
You're almost certainly corrupting the heap in your code somewhere. When new runs out of memory, it throws an exception and it sounds like that isn't happening.
I'm wondering if I'm reaching the limits of how many times I can use the "new" keyword or heap size.


For a rough idea of how much memory your program is using, you can look at the entry in Task Manager. If you're using several GB of memory, then you clearly either have a leak or are otherwise doing something very wrong with your memory management.

If you're not using all that much mem, the problem is probably something else. But that'd be the first thing to check.

EDIT: dhayden ninja'd me, and I concur with his response. Heap corruption is a likely candidate here.
Last edited on
Certainly heap corruption. I am only using 15MB of memory. Now the tick is debugging that.
Topic archived. No new replies allowed.