I have to debug program that rapidly allocates memory sometimes (Not by design.) and when it happens my whole computer just stop responding because physical memory goes 100% (I have 4GB ram), then I have to press the restarting button everytime with no way to know why did it happen.
Is there a way to limit new
's or malloc
's heap's size? By limiting I mean that it will throw exception like C#'s OutOfMemoryException
. NOTE: I can't just pick all the new
s and malloc
s and replace it with customized allocator, it's a lot of work there.
I tried setting Project Properties -> Configuration Properties -> Linker -> System -> Heap Reserve\Commit Size to 256MB
or 256000000
but nothing works.