Can a System.AccessViolationException happen because of faulty RAM?

妖精的绣舞 提交于 2019-12-01 20:44:37

Is it possible that faulty RAM could lead to an AccessViolationException?

Yes this is possible. If the underlying memory of a process is not behaving predictably then yes it could lead to many different types of application faults including an AccessViolationException.

Is in likely that faulty RAM is leading to an AccessViolationException?

I would say it's much more likely that a fault in your program or library you call is at fault. The first step though is finding out why or more importantly where the AccessViolationException is occurring. Try attaching a debugger, break on AccessViolationExceptions and see what is actually happening.

Also Ben S's suggestion is a good one to rule out the RAM case fast.

If you ever have doubts about faulty RAM, just run memtest86.

But if the error always happens in the same call, it's probably not RAM.

Does this only happen on your dev machine? If yes then faulty RAM/hard disk (page file) is very possible. You may also want to reinstall the .NET Framework in case one of the libraries (perhaps one of the Native Image DLLs) has become corrupted.

Simply put:

If the error occurs in different sections of code each time, that's a good indicator that something's wrong with your system as a whole.

On the other hand, if the error repeatedly occurs in the same piece of code, then it's almost certainly that piece of code that's at fault.

As a previous answer noted, use Memtest86+ to confirm that your memory is good or not.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!