GC max-heap-size monomer is not documented. Is it safe to use it in production?

I need to set the upper bound of the memory used by Mono.

According to the blogs, you can use the max-heap-size parameter to limit memory usage. According to experiments and in accordance with the code , it really does what I want.

However, this parameter is not documented .

Therefore: is it safe to rely on this option during the production process (or I have flaws that I do not see, for example, for example: there is no guarantee that they will still be available in a future version of Mono)?

+2
source share
2 answers

This is documented, and here is one way to get the documentation: export invalid MONO_GC_PARAMS , run mono :

 export MONO_GC_PARAMS=xxx mono sample.exe 

and get help:

 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 ak, m or ag suffix) soft-heap-limit=n (where N is an integer, possibly with ak, m or ag suffix) nursery-size=N (where N is an integer, possibly with ak, m or ag 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). 

As you can see, max-heap-size is specified, not in Experimental Options . Therefore, I would say that it is safe.

+6
source

This is described on the mono man page:

Sets the maximum heap size. The size is in bytes and must be a force of two. The suffixes k', m', and `g 'can be used to indicate kilo, meg, and gigabytes, respectively. A limit is the sum of a nursery, a large pile, and a large pile of an object. As soon as the limit Reached application receives OutOfMemoryExceptions when trying to allocate. Not the full amount of memory set to the maximum size is available to satisfy a single allocation due to internal fragmentation. By default, heap restrictions are disabled, and the GC will try to use all available memory.

0
source