c# – Mono:太多堆部分当app在内存中占用超过4 GB时,增加MAXHINCR或MAX_HEAP_SECTS
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了c# – Mono:太多堆部分当app在内存中占用超过4 GB时,增加MAXHINCR或MAX_HEAP_SECTS,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3065字,纯文字阅读大概需要5分钟。
内容图文
![c# – Mono:太多堆部分当app在内存中占用超过4 GB时,增加MAXHINCR或MAX_HEAP_SECTS](/upload/InfoBanner/zyjiaocheng/966/2e91e4a1f95641e4b7fd4ddb0da1bab2.jpg)
我在一个带有8 GB内存的bitnami linux上运行我的单声道应用程序.它是一个复杂的文件合并应用程序,它应该占用大量的RAM.
但每次需要超过4 GB的RAM时,它会崩溃,并显示以下错误消息:
Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS
Stacktrace:
at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0x0005e>
at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0x0005e>
at System.Collections.Generic.Dictionary`2<string, System.Nullable`1<int>>.InitArrays (int) <0x00040>
at System.Collections.Generic.Dictionary`2<string, System.Nullable`1<int>>.Init (int,System.Collections.Generic.IEqualityComparer`1<string>) <0x00091>
at System.Collections.Generic.Dictionary`2<string, System.Nullable`1<int>>..ctor () <0x0001b>
at lawyerGatherBot.Merger.LawyerRepresentation..ctor (string) <0x00080>
at lawyerGatherBot.Merger.MergeLawyerRecords.Map (System.Collections.Generic.IEnumerable`1<string>) <0x00167>
at lawyerGatherBot.Program.Main (string[]) <0x00161>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0x00082>
Native stacktrace:
mono() [0x48bd6b]
/lib/libpthread.so.0(+0xf8f0) [0x7f6c4198a8f0]
/lib/libc.so.6(gsignal+0x35) [0x7f6c4162ba75]
/lib/libc.so.6(abort+0x180) [0x7f6c4162f5c0]
mono() [0x5da188]
mono() [0x5d7ec0]
mono() [0x5d8349]
mono() [0x5d8534]
mono() [0x5d86f1]
mono() [0x5d3571]
mono() [0x5d4752]
mono() [0x5d50e5]
mono(mono_array_new_specific+0xba) [0x53716a]
[0x40df9f2f]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted
这是mono -V的输出:
Mono JIT compiler version 2.8.2 (tarball Tue Aug 30 18:06:04 UTC 2011)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: debugger softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
我应该怎么做才能在单声道上运行内存密集型应用程序?
*更新
我搞砸了32位系统的应用程序.因此,这个错误.
解决方法:
我的理解是这个错误源于Boehm GC.
先试试这个.使用下面的脚本从源代码下载和构建.在脚本的配置部分中,进行以下更改:
./configure –with-large-heap = yes
除了您要设置的任何其他配置问题之外,还要执行此操作.这应该设置LARGE_CONFIG标志.
如果你想手动设置它(我不知道为什么),这里是步骤:
>下载单声道源并在此处运行脚本
http://www.integratedwebsystems.com/2011/08/install-mono-2-10-3-on-ubuntu-using-bash-script/
>现在返回并将以下代码添加到顶部
建立/单2.10.8 / libgc /包括/ gc_config_macros.h
#ifndef LARGE_CONFIG
#define LARGE_CONFIG
#endif
>现在进行构建/ mono-2.10.8并运行
使
sudo make install
希望这将编译一个解决您的问题的新单声道.生成的单声道将在/ opt中
一些受影响最大的代码是在libgc / include / private / gc_priv.h中,但是维护者很好地为LARGE_CONFIG标志放置了条件,所以最好使用它.
内容总结
以上是互联网集市为您收集整理的c# – Mono:太多堆部分当app在内存中占用超过4 GB时,增加MAXHINCR或MAX_HEAP_SECTS全部内容,希望文章能够帮你解决c# – Mono:太多堆部分当app在内存中占用超过4 GB时,增加MAXHINCR或MAX_HEAP_SECTS所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。