Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A new guard page for the stack cannot be created

Tags:

c#-4.0

We are using C# Application For Developement.

We are using COM component for Rendering and Displaying Image File In ImageViewer. Sometimes we got Weird System Error As 'A new guard page for the stack cannot be created.' After this error Application Get Exited.

Is any one have idea why this Error Arise ? As there is no specific case to replicate same error.

Thanks

like image 964
Viral Avatar asked Jul 16 '14 11:07

Viral


1 Answers

I was having the same exception but in a different context. I was running a windows service to do some very heavy processment (no COM objects here).

In my case, I found a memory leak in my code that was producing the error "A new guard page for the stack cannot be created." due to out of memory.

I know your question is now 2 years old.. Even though I'm sharing this to help any future reader. VS 2015 has now a nice tool to monitor memory usage during the debug.

-------- Edit ------

Another common scenario for this exception is running out of stack due a recursive call.

like image 90
Zé Carlos Avatar answered Oct 01 '22 05:10

Zé Carlos