我需要为Mono使用的内存设置一个上限。
根据blogs,可以使用参数max-heap-size
限制内存使用量。
根据实验和according to the code,它确实可以实现我想要的功能。
但是,此选项isn't documented。
因此:在生产中依靠此选项是否安全(或者它具有我看不见的缺点,例如:无法保证在将来的Mono版本中仍然可用)?
参考方案
它已被记录,这是获取文档的一种方法:export
无效的MONO_GC_PARAMS
,启动mono
:
export MONO_GC_PARAMS=xxx
mono sample.exe
并获得帮助:
Warning: In environment variable `MONO_GC_PARAMS': Unknown option `xxx`. - Ignoring.
MONO_GC_PARAMS must be a comma-delimited list of one or more of the following:
max-heap-size=N (where N is an integer, possibly with a k, m or a g suffix)
soft-heap-limit=n (where N is an integer, possibly with a k, m or a g suffix)
nursery-size=N (where N is an integer, possibly with a k, m or a g suffix)
major=COLLECTOR (where COLLECTOR is `marksweep', `marksweep-conc', `marksweep-par', 'marksweep-fixed' or 'marksweep-fixed-par')
minor=COLLECTOR (where COLLECTOR is `simple' or `split')
wbarrier=WBARRIER (where WBARRIER is `remset' or `cardtable')
stack-mark=MARK-METHOD (where MARK-METHOD is 'precise' or 'conservative')
[no-]cementing
evacuation-threshold=P (where P is a percentage, an integer in 0-100)
(no-)lazy-sweep
Experimental options:
save-target-ratio=R (where R must be between 0.10 - 2.00).
default-allowance-ratio=R (where R must be between 1.00 - 10.00).
如您所见,列出了max-heap-size
,而不是Experimental Options
。所以我说这很安全。
This question already has answers here: Weird behaviour initializing a numpy array of string data (4个答案) …
TypeError:'str'对象不支持项目分配,带有json文件的python - python以下是我的代码import json with open('johns.json', 'r') as q: l = q.read() data = json.loads(l) data['john'] = '{}' data['john']['use…
R'relaimpo'软件包的Python端口 - python我需要计算Lindeman-Merenda-Gold(LMG)分数,以进行回归分析。我发现R语言的relaimpo包下有该文件。不幸的是,我对R没有任何经验。我检查了互联网,但找不到。这个程序包有python端口吗?如果不存在,是否可以通过python使用该包? python参考方案 最近,我遇到了pingouin库。
如何用'-'解析字符串到节点js本地脚本? - python我正在使用本地节点js脚本来处理字符串。我陷入了将'-'字符串解析为本地节点js脚本的问题。render.js:#! /usr/bin/env -S node -r esm let argv = require('yargs') .usage('$0 [string]') .argv; console.log(argv…
如果我得到url(''),我该如何使用另一个URL - javascript我是新手,正在写这篇文章,但是如果源上没有图像,那么我只有空白。有人可以告诉我,如果我正在获取背景图像,如何获取/images/no-image.jpg:url();这是我的代码:<div class="uk-clearfix uk-position-relative"> <div class="recipeb…