[英]Mono: Too many heap sections Increase MAXHINCR or MAX_HEAP_SECTS when app takes more than 4 GB in memory
我在一个带有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位系统的应用程序。 因此,这个错误。
使用mono 2.10.2或更高版本(可能使用带有选项--gc = sgen的新GC)。 你的单声道版本很老了。
我的理解是这个错误源于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
让sudo make install
希望这将编译一个解决您的问题的新单声道。 生成的单声道将在/ opt中
一些受影响最大的代码是在libgc / include / private / gc_priv.h中,但是维护者很好地为LARGE_CONFIG标志放置了条件,所以最好使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.