单声道:太多堆路段增加MAXHINCR或MAX_HEAP_SECTS当应用程序在内存占用超过4 GB [英] Mono: Too many heap sections Increase MAXHINCR or MAX_HEAP_SECTS when app takes more than 4 GB in memory
问题描述
我运行我的单应用程序在bitnami linux与8 GB的内存。它是一个复杂的文件合并应用程序,它应该需要大量的RAM,因为它的工作原理。
但每次它需要超过4 GB的RAM,它崩溃,并显示以下错误信息:
I am running my mono application at a bitnami linux with 8 GB of memory. It is a sophisticated file merger application, which is supposed to take a lot of RAM as it works. But every time it takes more than 4 GB of RAM, it crashes with following error message:
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的输出:
Here's the output of 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)
能够在单声道上运行内存密集型应用程序吗?
What should I do to be able to run memory-intensive apps on mono?
* UPDATE
我为32位系统编译和编译应用程序。因此,这个错误。
*UPDATE I screw up and compiled the app for 32 bit systems. Hence, this error.
推荐答案
我的理解是,这个错误来自于Boehm GC。
My understanding is that this error stems from the Boehm GC.
请先尝试此操作。使用下面的脚本从源代码下载和构建。在脚本的configure部分进行此更改:
Try this first. Download and build from source using the script below. In the configure part of the script, make this change:
./ configure --with-large-heap = yes
./configure --with-large-heap=yes
除了要设置的其他任何配置问题之外,还要执行此操作。这应该设置LARGE_CONFIG标志。
Do this in addition to whatever other config issues you want to set. This should set the LARGE_CONFIG flag.
如果你想手动设置它(我不知道为什么),这里是步骤:
If you wanted to set it manually (I don't know why), here are the steps:
- 下载单声道来源并在此处运行脚本
http://www.integratedwebsystems .com / 2011/08 / install-mono-2-10-3-on-ubuntu-using-bash-script /
- 现在返回并在 顶部添加以下代码:
- Now go back and add the following code to the top of
build / mono-2.10.8 / libgc / include / gc_config_macros.h
build/mono-2.10.8/libgc/include/gc_config_macros.h
#ifndef LARGE_CONFIG
#define LARGE_CONFIG
#endif
- 现在开始构建/ mono-2.10.8并运行
make
sudo make install
make sudo make install
希望这将编译一个新的单声道解决你的问题。生成的mono将在/ opt
Hopefully this will compile a new mono that solves your problem. The resulting mono will be in /opt
一些最受影响的代码在libgc / include / private / gc_priv.h中,但是维护者很好地把条件对于LARGE_CONFIG标志,因此最好使用它。
Some of the most affected code is in libgc/include/private/gc_priv.h, but the maintainers have nicely put conditionals all over for the LARGE_CONFIG flag, so it's probably best to work with that.
这篇关于单声道:太多堆路段增加MAXHINCR或MAX_HEAP_SECTS当应用程序在内存占用超过4 GB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!