开发者

exception of type 'system.outofmemoryexception' was thrown

开发者 https://www.devze.com 2022-12-28 13:32 出处:网络
My page throws error exception of type \'system.outofmemoryexception\' was thrown . This happens when i press submit button in submit button there are sqlconnections with stored procedure as im popul

My page throws error exception of type 'system.outofmemoryexception' was thrown .

This happens when i press submit button in submit button there are sqlconnections with stored procedure as im populating grid with data .

It gives error when i put code in submit button. But when i put tht on page load it works good .

Can anyo开发者_Python百科ne help me on this .

Thanks, Smartdev


Since my comment got upvotes...I figured I'd post it as an answer.

Without seeing all of your code, it's nearly impossible to tell you why you're getting the Exception.

That said, my guess would be that you have a race condition somehwhere in your event handler that is causing the System to run out of memory. Most likely it's either an infinite loop or an un-terminated recursive method.


This means, that you allocated too much memory in your program. Either buy more memory in a hardware retail shop or use less memory in your program.


Something strange is happening -- that's all I can tell you from your description.

It could be a bug third-party control. It could be a bug in your code, it could be something "pinning" memory somewhere. You could legitimately be out of memory...

You should post a complete stack trace of the error. Post your memory utilization statistics. Post some code from where you think the error is happening.


See Exception of type 'System.OutOfMemoryException' was thrown for my answer to the same question:

In short you have a recursive call somewhere in your code (and not necessarily on purpose) i.e.

Class A{

    ctor(){
      var a = new A();// oops!!
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消