Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
Posted
Updated 23-Mar-12 22:01pm
v2
Comments
Mehdi Gholam 24-Mar-12 4:01am    
And your question?

We can't positively tell you from the tiny code fragment what exactly is wrong, and tell you "do this" and it'll fix it.
However, I would start by breakpointing the Invoke line and see ing what exactly is being invoked - and from where.

The chances are that you have set up a recursive loop somewhere, and it is just calling itself until it runs out of space.
 
Share this answer
 
Comments
Clifford Nelson 24-Mar-12 4:40am    
I agree. There is almost definatley some sort of recursion problem, and sometimes it is very subtle. Breaking is the bestt option
I am Having Same Problem
But i think it may be because you are not reallocating the
memory
so you can try to call garbage collector by executing
gc.collect() method
 
Share this answer
 
Comments
Nelek 24-Mar-12 6:16am    
Multiple personalities here? or you forgot to log in in the other account?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900