没有记录Mono GC max-heap-size.在生产中使用是否安全?

gtu*_*rri 2 c# mono garbage-collection

我需要设置Mono使用的内存的上限.

根据博客,可以使用该参数max-heap-size来限制内存使用量.根据实验,并根据代码,它确实做我想要的.

但是,此选项未记录.

因此:在生产中依赖此选项是否安全(或者它是否具有我看不到的缺点,例如:不保证在未来的Mono版本中仍然可用)?

Ste*_*oix 6

它是记录在案的,这是获取文档的一种方法:export无效MONO_GC_PARAMS,开始mono:

export MONO_GC_PARAMS=xxx
mono sample.exe
Run Code Online (Sandbox Code Playgroud)

并获得帮助:

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).
Run Code Online (Sandbox Code Playgroud)

如你所见max-heap-size,列出了,而不是在Experimental Options.所以我说这是安全的.

  • 我只是认为这不回答这个问题.只会使它失效:/ (2认同)