Mono在Ubuntu而不是OSX或Windows上抛出OutOfMemoryException [英] Mono throws OutOfMemoryException on Ubuntu but not OSX or Windows

查看:99
本文介绍了Mono在Ubuntu而不是OSX或Windows上抛出OutOfMemoryException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Ubuntu服务器上安装了Mono,并且"Hello World"正在运行,但是经过简化的应用程序可以进行一些数组处理,并且可以在OSX或Windows的Mono下正常运行.

System.OutOfMemoryException: Out of memory.
  at (wrapper alloc) object:AllocVector (intptr,intptr)

它所需要的内存不应超过几个MB.该服务器具有4GB的RAM.

在alloc配置文件下再次运行会产生不同的异常:

System.OverflowException: Number overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)

问题不一致,有时代码运行一次,但是第二次运行.有时,这不是第一次起作用.有时,由于相同的原因,它会以不同的方法失败.

可以在 http://dev.intelorca.co上下载程序和完整输出. .uk/2014/gacj_allocproblem.zip 最好查看是否有人在单声道下运行程序时遇到问题,并且可以提供有关问题所在的任何见解.任何将Mono配置为在Ubuntu上更好地运行的指示也将有所帮助.

程序应输出128次"Cambridge Surprise Major".

解决方案

问题是由于Mono的amd64体系结构的即时编译器中的错误所致.该问题已于2015年1月3日修复.

错误报告: https://bugzilla.xamarin.com/show_bug.cgi?id = 25631
修复: https://github.com/mono/mono/commit/9e03c10d8fefea9210ca015cf484e819623c0a1a >

I have installed Mono on an Ubuntu server and "Hello World" is working, but a simplified application that does some array handling and runs without problem under Mono on OSX or Windows is giving:

System.OutOfMemoryException: Out of memory.
  at (wrapper alloc) object:AllocVector (intptr,intptr)

It should not require more than a few MB of memory. The server has 4GB of RAM.

Running again under alloc profile gives a different exception:

System.OverflowException: Number overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)

The problem is inconsistent, sometimes the code runs once but then not a second time. Sometimes it doesn't work for the first time. Sometimes it fails in a different method but for the same reason.

The program and full output can be downloaded at http://dev.intelorca.co.uk/2014/gacj_allocproblem.zip It would be good to see if anyone else has problems running the program under mono and can provide any insight on what the problem is. Any pointers to configuring Mono to run better on Ubuntu would also be helpful.

The program should output "Cambridge Surprise Major" 128 times.

解决方案

The problem was due to a bug in Mono's just-in-time compiler with the amd64 architecture. This has been fixed as of 3 Jan 2015.

Bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=25631
Fix: https://github.com/mono/mono/commit/9e03c10d8fefea9210ca015cf484e819623c0a1a

这篇关于Mono在Ubuntu而不是OSX或Windows上抛出OutOfMemoryException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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