设置C#内存参数 [英] Setting C# Memory Parameters

查看:200
本文介绍了设置C#内存参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我还是C#的新手,但我很好奇是否有一种方法可以告诉Windows它需要预留X内存来运行此应用程序.

While I am still new to C# I'm curious if there is a way to tell windows that it needs to set aside X memory to run this application.

在调试(F5)时,偶尔会收到随机的向受保护的内存写入错误"通知,通常在重新启动Visual Studio版本后可以使用一会儿.偶尔需要Windows重新启动.因此,我假设我需要为Windows指定一个更大的内存大小,以便预留空间,然后再收集.

While debugging (F5) I occasionally get a random "error writing to protected memory" notice, and it's usually fine for a bit after I restart the version of Visual Studio. Once in a while it takes a windows Reboot. So I'm assuming I need to specify somewhere a larger memory size for windows to set aside and then collect later.

有想法吗?

推荐答案

这不是指定更多内存的问题.这听起来像是您在CLR中遇到了一些极端情况,或者是您正在使用一些行为不当的非托管代码,或者您的内存不好.

That's not a matter of specifying more memory. That sounds like either you've hit some corner case in the CLR, or you're using some unmanaged code which is misbehaving, or you've got some bad memory.

在不进行调试时,您是否遇到过此问题?通常是在同一代码区域内吗?

Do you ever see this problem when not debugging? Is it usually around the same area of code?

这篇关于设置C#内存参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆