1Mono(mono) Mono(mono)
2
3
4
6 mono - Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-
7 of-Time)
8
10 mono [options] file [arguments...]
11
12 mono-sgen [options] file [arguments...]
13
15 mono is a runtime implementation of the ECMA Common Language Infra‐
16 structure. This can be used to run ECMA and .NET applications.
17
18 The runtime loads the specified file and optionally passes the argu‐
19 ments to it. The file is an ECMA assembly. They typically have a .exe
20 or .dll extension.
21
22 These executables can reference additionaly functionality in the form
23 of assembly references. By default those assembly references are
24 resolved as follows: the mscorlib.dll is resolved from the system pro‐
25 file that is configured by Mono, and other assemblies are loaded from
26 the Global Assembly Cache (GAC).
27
28 The runtime contains a native code generator that transforms the Common
29 Intermediate Language into native code.
30
31 The code generator can operate in two modes: just in time compilation
32 (JIT) or ahead of time compilation (AOT). Since code can be dynami‐
33 cally loaded, the runtime environment and the JIT are always present,
34 even if code is compiled ahead of time.
35
36 The runtime provides a number of configuration options for running
37 applications, for developing and debugging, and for testing and debug‐
38 ging the runtime itself.
39
40 The mono command uses the moving and generational SGen garbage collec‐
41 tor while the mono-boehm command uses the conservative Boehm garbage
42 collector.
43
45 On Unix-based systems, Mono provides a mechanism to emulate the Win‐
46 dows-style file access, this includes providing a case insensitive view
47 of the file system, directory separator mapping (from \ to /) and
48 stripping the drive letters.
49
50 This functionality is enabled by setting the MONO_IOMAP environment
51 variable to one of all, drive and case.
52
53 See the description for MONO_IOMAP in the environment variables section
54 for more details.
55
57 A number of diagnostic command line options take as argument a method
58 description. A method description is a textual representation that
59 can be used to uniquely identify a method. The syntax is as follows:
60 [namespace]classname:methodname[(arguments)]
61
62 The values in brackets are optional, like the namespace and the argu‐
63 ments. The arguments themselves are either empty, or a comma-sepa‐
64 rated list of arguments. Both the classname and methodname can be set
65 to the special value '*' to match any values (Unix shell users should
66 escape the argument to avoid the shell interpreting this).
67
68 The arguments, if present should be a comma separated list of types
69 either a full typename, or for built-in types it should use the low-
70 level ILAsm type names for the built-in types, like 'void', 'char',
71 'bool', 'byte', 'sbyte', 'uint16', 'int16', 'uint',
72
73 Pointer types should be the name of the type, followed by a '*', arrays
74 should be the typename followed by '[' one or more commas (to indicate
75 the rank of the array), and ']'.
76
77 Generic values should use '<', one or more type names, separated by
78 both a comma and a space and '>'.
79
80 By-reference arguments should include a "&" after the typename.
81
82 Examples:
83 *:ctor(int) // All constructors that take an int as an argument
84 *:Main // Methods named Main in any class
85 *:Main(string[]) // Methods named Main that take a string array in any class
86
88 The following options are available:
89
90 --aot, --aot[=options]
91 This option is used to precompile the CIL code in the specified
92 assembly to native code. The generated code is stored in a file
93 with the extension .so. This file will be automatically picked
94 up by the runtime when the assembly is executed. Ahead-of-Time
95 compilation is most useful if you use it in combination with the
96 -O=all,-shared flag which enables all of the optimizations in
97 the code generator to be performed. Some of those optimizations
98 are not practical for Just-in-Time compilation since they might
99 be very time consuming. Unlike the .NET Framework, Ahead-of-
100 Time compilation will not generate domain independent code: it
101 generates the same code that the Just-in-Time compiler would
102 produce. Since most applications use a single domain, this is
103 fine. If you want to optimize the generated code for use in
104 multi-domain applications, consider using the -O=shared flag.
105 This pre-compiles the methods, but the original assembly is
106 still required to execute as this one contains the metadata and
107 exception information which is not available on the generated
108 file. When precompiling code, you might want to compile with
109 all optimizations (-O=all). Pre-compiled code is position inde‐
110 pendent code. Precompilation is just a mechanism to reduce
111 startup time, increase code sharing across multiple mono pro‐
112 cesses and avoid just-in-time compilation program startup costs.
113 The original assembly must still be present, as the metadata is
114 contained there. AOT code typically can not be moved from one
115 computer to another (CPU-specific optimizations that are
116 detected at runtime) so you should not try to move the pre-gen‐
117 erated assemblies or package the pre-generated assemblies for
118 deployment. A few options are available as a parameter to the
119 --aot command line option. The options are separated by com‐
120 mas, and more than one can be specified:
121
122 asmonly
123 Instructs the AOT compiler to output assembly code
124 instead of an object file.
125
126 bind-to-runtime-version
127 If specified, forces the generated AOT files to be bound
128 to the runtime version of the compiling Mono. This will
129 prevent the AOT files from being consumed by a different
130 Mono runtime.
131
132 data-outfile=FILE.dll.aotdata
133 This instructs the AOT code generator to output certain
134 data constructs into a separate file. This can reduce
135 the executable images some five to twenty percent.
136 Developers need to then ship the resulting aotdata as a
137 resource and register a hook to load the data on demand
138 by using the mono_install_load_aot_data_hook method.
139
140 direct-icalls
141 When this option is specified, icalls (internal calls
142 made from the standard library into the mono runtime
143 code) are invoked directly instead of going through the
144 operating system symbol lookup operation. This requires
145 use of the static option.
146
147 direct-pinvoke
148 When this option is specified, P/Invoke methods are
149 invoked directly instead of going through the operating
150 system symbol lookup operation. This requires use of the
151 static option.
152
153 dwarfdebug
154 Instructs the AOT compiler to emit DWARF debugging infor‐
155 mation. When used together with the nodebug option, only
156 DWARF debugging information is emitted, but not the
157 information that can be used at runtime.
158
159 full This creates binaries which can be used with the --full-
160 aot option.
161
162 hybrid This creates binaries which can be used with the
163 --hybrid-aot option.
164
165 llvm AOT will be performed with the LLVM backend instead of
166 the Mono backend where possible. This will be slower to
167 compile but most likely result in a performance improve‐
168 ment.
169
170 llvmonly
171 AOT will be performed with the LLVM backend exclusively
172 and the Mono backend will not be used. The only output in
173 this mode will be the bitcode file normally specified
174 with the llvm-outfile option. Use of llvmonly automati‐
175 cally enables the full and llvm options. This feature is
176 experimental.
177
178 llvmopts=[options]
179 Use this option to override the built-in set of flags
180 passed to the LLVM optimizer. The list of possible
181 flags that can be passed can be obtained by calling the
182 bundled opt program that comes with Mono.
183
184 llvmllc=[options]
185 Use this option to override the built-in set of flags
186 passed to the LLVM static compiler (llc). The list of
187 possible flags that can be passed can be obtained by
188 calling the bundled llc program that comes with Mono.
189
190 llvm-outfile=[filename]
191 Gives the path for the temporary LLVM bitcode file cre‐
192 ated during AOT. dedup Each AOT module will typically
193 contain the code for inflated methods and wrappers that
194 are called by code in that module. In dedup mode, we
195 identify and skip compiling all of those methods. When
196 using this mode with fullaot, dedup-include is required
197 or these methods will remain missing.
198
199 dedup-include=[filename]
200 In dedup-include mode, we are in the pass of compilation
201 where we compile the methods that we had previously
202 skipped. All of them are emitted into the assembly that
203 is passed as this option. We consolidate the many dupli‐
204 cate skipped copies of the same method into one.
205
206
207 info Print the architecture the AOT in this copy
208 of Mono targets and quit.
209
210 interp Generates all required wrappers, so that it
211 is possible to run --interpreter without
212 any code generation at runtime. This
213 option only makes sense with mscorlib.dll.
214 Embedders can set
215
216 mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
217
218 ld-flags
219 Additional flags to pass to the C linker
220 (if the current AOT mode calls for invoking
221 it).
222
223 llvm-path=<PREFIX>
224 Same for the llvm tools 'opt' and 'llc'.
225
226 msym-dir=<PATH>
227 Instructs the AOT compiler to generate off‐
228 line sequence points .msym files. The gen‐
229 erated .msym files will be stored into a
230 subfolder of <PATH> named as the compila‐
231 tion AOTID.
232
233 mtriple=<TRIPLE>
234 Use the GNU style target triple <TRIPLE> to
235 determine some code generation options,
236 i.e. --mtriple=armv7-linux-gnueabi will
237 generate code that targets ARMv7. This is
238 currently only supported by the ARM back‐
239 end. In LLVM mode, this triple is passed on
240 to the LLVM llc compiler.
241
242 nimt-trampolines=[number]
243 When compiling in full aot mode, the IMT
244 trampolines must be precreated in the AOT
245 image. You can add additional method tram‐
246 polines with this argument. Defaults to
247 512.
248
249 ngsharedvt-trampolines=[number]
250 When compiling in full aot mode, the value
251 type generic sharing trampolines must be
252 precreated in the AOT image. You can add
253 additional method trampolines with this
254 argument. Defaults to 512.
255
256 nodebug
257 Instructs the AOT compiler to not output
258 any debugging information.
259
260 no-direct-calls
261 This prevents the AOT compiler from gener‐
262 ating a direct calls to a method. The AOT
263 compiler usually generates direct calls for
264 certain methods that do not require going
265 through the PLT (for example, methods that
266 are known to not require a hook like a
267 static constructor) or call into simple
268 internal calls.
269
270 nrgctx-trampolines=[number]
271 When compiling in full aot mode, the
272 generic sharing trampolines must be precre‐
273 ated in the AOT image. You can add addi‐
274 tional method trampolines with this argu‐
275 ment. Defaults to 4096.
276
277 nrgctx-fetch-trampolines=[number]
278 When compiling in full aot mode, the
279 generic sharing fetch trampolines must be
280 precreated in the AOT image. You can add
281 additional method trampolines with this
282 argument. Defaults to 128.
283
284 ntrampolines=[number]
285 When compiling in full aot mode, the method
286 trampolines must be precreated in the AOT
287 image. You can add additional method tram‐
288 polines with this argument. Defaults to
289 4096.
290
291 outfile=[filename]
292 Instructs the AOT compiler to save the out‐
293 put to the specified file.
294
295 print-skipped-methods
296 If the AOT compiler cannot compile a method
297 for any reason, enabling this flag will
298 output the skipped methods to the console.
299
300 profile=[file]
301 Specify a file to use for profile-guided
302 optimization. See the AOT profiler sub-sec‐
303 tion. To specify multiple files, include
304 the profile option multiple times.
305
306 profile-only
307 AOT *only* the methods described in the
308 files specified with the profile option.
309 See the AOT profiler sub-section.
310
311 readonly-value=namespace.typename.field‐
312 name=type/value
313 Override the value of a static readonly
314 field. Usually, during JIT compilation, the
315 static constructor is ran eagerly, so the
316 value of a static readonly field is known
317 at compilation time and the compiler can do
318 a number of optimizations based on it. Dur‐
319 ing AOT, instead, the static constructor
320 can't be ran, so this option can be used to
321 set the value of such a field and enable
322 the same set of optimizations. Type can be
323 any of i1, i2, i4 for integers of the
324 respective sizes (in bytes). Note that
325 signed/unsigned numbers do not matter here,
326 just the storage size. This option can be
327 specified multiple times and it doesn't
328 prevent the static constructor for the type
329 defining the field to execute with the
330 usual rules at runtime (hence possibly com‐
331 puting a different value for the field).
332
333 save-temps,keep-temps
334 Instructs the AOT compiler to keep tempo‐
335 rary files.
336
337 soft-debug
338 This instructs the compiler to generate
339 sequence point checks that allow Mono's
340 soft debugger to debug applications even on
341 systems where it is not possible to set
342 breakpoints or to single step (certain
343 hardware configurations like the cell
344 phones and video gaming consoles).
345
346 static Create an ELF object file (.o) or .s file
347 which can be statically linked into an exe‐
348 cutable when embedding the mono runtime.
349 When this option is used, the object file
350 needs to be registered with the embedded
351 runtime using the mono_aot_register_module
352 function which takes as its argument the
353 mono_aot_module_<ASSEMBLY NAME>_info global
354 symbol from the object file:
355
356 extern void *mono_aot_module_hello_info;
357
358 mono_aot_register_module (mono_aot_module_hello_info);
359
360 stats Print various stats collected during AOT
361 compilation.
362
363 temp-path=[path]
364 Explicitly specify path to store temporary
365 files created during AOT compilation.
366
367 threads=[number]
368 This is an experimental option for the AOT
369 compiler to use multiple threads when com‐
370 piling the methods.
371
372 tool-prefix=<PREFIX>
373 Prepends <PREFIX> to the name of tools ran
374 by the AOT compiler, i.e. 'as'/'ld'. For
375 example, --tool=prefix=arm-linux-gnueabi-
376 will make the AOT compiler run
377
378 verbose
379 Prints additional information about type
380 loading failures.
381
382 write-symbols,no-write-symbols
383 Instructs the AOT compiler to emit (or not
384 emit) debug symbol information.
385
386 no-opt Instructs the AOT compiler tot no call opt
387 when compiling with LLVM.
388
389 For more information about AOT, see:
390 http://www.mono-project.com/docs/advanced/aot/
391
392 --aot-path=PATH
393 List of additional directories to search for AOT
394 images.
395
396 --apply-bindings=FILE
397 Apply the assembly bindings from the specified
398 configuration file when running the AOT compiler.
399 This is useful when compiling an auxiliary assem‐
400 bly that is referenced by a main assembly that
401 provides a configuration file. For example, if
402 app.exe uses lib.dll then in order to make the
403 assembly bindings from app.exe.config available
404 when compiling lib.dll ahead of time, use:
405 mono --apply-bindings=app.exe.config --aot lib.dll
406
407 --assembly-loader=MODE
408 If mode is strict, Mono will check that the public
409 key token, culture and version of a candidate
410 assembly matches the requested strong name. If
411 mode is legacy, as long as the name matches, the
412 candidate will be allowed. strict is the behavior
413 consistent with .NET Framework but may break some
414 existing mono-based applications. The default is
415 legacy.
416
417 --attach=[options]
418 Currently the only option supported by this com‐
419 mand line argument is disable which disables the
420 attach functionality.
421
422 --config filename
423 Load the specified configuration file instead of
424 the default one(s). The default files are
425 /etc/mono/config and ~/.mono/config or the file
426 specified in the MONO_CONFIG environment variable,
427 if set. See the mono-config(5) man page for
428 details on the format of this file.
429
430 --debugger-agent=[options]
431 This instructs the Mono runtime to start a debug‐
432 ging agent inside the Mono runtime and connect it
433 to a client user interface will control the Mono
434 process. This option is typically used by IDEs,
435 like the MonoDevelop or Visual Studio IDEs.
436 The configuration is specified using one of more
437 of the following options:
438
439 address=host:port
440 Use this option to specify the IP
441 address where your debugger client
442 is listening to.
443
444 loglevel=LEVEL
445 Specifies the diagnostics log level
446 for
447
448 logfile=filename
449 Used to specify the file where the
450 log will be stored, it defaults to
451 standard output.
452
453 server=[y/n]
454 Defaults to no, with the default
455 option Mono will actively connect to
456 the host/port configured with the
457 address option. If you set it to
458 'y', it instructs the Mono runtime
459 to start debugging in server mode,
460 where Mono actively waits for the
461 debugger front end to connect to the
462 Mono process. Mono will print out
463 to stdout the IP address and port
464 where it is listening.
465
466 setpgid=[y/n]
467 If set to yes, Mono will call
468 setpgid(0, 0) on startup, if that
469 function is available on the system.
470 This is useful for ensuring that
471 signals delivered to a process that
472 is executing the debuggee are not
473 propagated to the debuggee, e.g.
474 when Ctrl-C sends SIGINT to the sdb
475 tool.
476
477 suspend=[y/n]
478 Defaults to yes, with the default
479 option Mono will suspend the vm on
480 startup until it connects success‐
481 fully to a debugger front end. If
482 you set it to 'n', in conjunction
483 with server=y, it instructs the Mono
484 runtime to run as normal, while
485 caching metadata to send to the
486 debugger front end on connection..
487
488 transport=transport_name
489 This is used to specify the trans‐
490 port that the debugger will use to
491 communicate. It must be specified
492 and currently requires this to be
493 'dt_socket'.
494
495 --desktop
496 Configures the virtual machine to be better
497 suited for desktop applications. Currently
498 this sets the GC system to avoid expanding
499 the heap as much as possible at the expense
500 of slowing down garbage collection a bit.
501
502 --full-aot
503 This flag instructs the Mono runtime to not
504 generate any code at runtime and depend
505 exclusively on the code generated from
506 using mono --aot=full previously. This is
507 useful for platforms that do not permit
508 dynamic code generation, or if you need to
509 run assemblies that have been stripped of
510 IL (for example using mono-cil-strip).
511 Notice that this feature will abort execu‐
512 tion at runtime if a codepath in your pro‐
513 gram, or Mono's class libraries attempts to
514 generate code dynamically. You should test
515 your software upfront and make sure that
516 you do not use any dynamic features.
517
518 --full-aot-interp
519 Same as --full-aot with fallback to the
520 interpreter.
521
522 --gc=boehm, --gc=sgen
523 Selects the Garbage Collector engine for
524 Mono to use, Boehm or SGen. Currently this
525 merely ensures that you are running either
526 the mono or mono-sgen commands. This
527 flag can be set in the MONO_ENV_OPTIONS
528 environment variable to force all of your
529 child processes to use one particular kind
530 of GC with the Mono runtime.
531
532 --gc-debug=[options]
533 Command line equivalent of the
534 MONO_GC_DEBUG environment variable.
535
536 --gc-params=[options]
537 Command line equivalent of the
538 MONO_GC_PARAMS environment variable.
539
540 --arch=32, --arch=64
541 (Mac OS X only): Selects the bitness of the
542 Mono binary used, if available. If the
543 binary used is already for the selected
544 bitness, nothing changes. If not, the exe‐
545 cution switches to a binary with the
546 selected bitness suffix installed side by
547 side (for example, '/bin/mono --arch=64'
548 will switch to '/bin/mono64' iff
549 '/bin/mono' is a 32-bit build).
550
551 --help, -h
552 Displays usage instructions.
553
554 --interpreter
555 The Mono runtime will use its interpreter
556 to execute a given assembly. The inter‐
557 preter is usually slower than the JIT, but
558 it can be useful on platforms where code
559 generation at runtime is not allowed.
560
561 --hybrid-aot
562 This flag allows the Mono runtime to run
563 assemblies that have been stripped of IL,
564 for example using mono-cil-strip. For this
565 to work, the assembly must have been AOT
566 compiled with --aot=hybrid.
567
568 This flag is similar to --full-aot, but it
569 does not disable the JIT. This means you
570 can use dynamic features such as Sys‐
571 tem.Reflection.Emit.
572
573 --llvm If the Mono runtime has been compiled with
574 LLVM support (not available in all configu‐
575 rations), Mono will use the LLVM optimiza‐
576 tion and code generation engine to JIT or
577 AOT compile. For more information, con‐
578 sult: http://www.mono-
579 project.com/docs/advanced/mono-llvm/
580
581 --nollvm
582 When using a Mono that has been compiled
583 with LLVM support, it forces Mono to fall‐
584 back to its JIT engine and not use the LLVM
585 backend.
586
587 --optimize=MODE, -O=MODE
588 MODE is a comma separated list of optimiza‐
589 tions. They also allow optimizations to be
590 turned off by prefixing the optimization
591 name with a minus sign. In general, Mono
592 has been tuned to use the default set of
593 flags, before using these flags for a
594 deployment setting, you might want to actu‐
595 ally measure the benefits of using them.
596 The following optimization flags are imple‐
597 mented in the core engine:
598 abcrem Array bound checks removal
599 all Turn on all optimizations
600 aot Usage of Ahead Of Time compiled code
601 branch Branch optimizations
602 cfold Constant folding
603 cmov Conditional moves [arch-dependency]
604 deadce Dead code elimination
605 consprop Constant propagation
606 copyprop Copy propagation
607 fcmov Fast x86 FP compares [arch-dependency]
608 float32 Perform 32-bit float arithmetic using 32-bit operations
609 gshared Enable generic code sharing.
610 inline Inline method calls
611 intrins Intrinsic method implementations
612 linears Linear scan global reg allocation
613 leaf Leaf procedures optimizations
614 loop Loop related optimizations
615 peephole Peephole postpass
616 precomp Precompile all methods before executing Main
617 sched Instruction scheduling
618 shared Emit per-domain code
619 sse2 SSE2 instructions on x86 [arch-dependency]
620 tailc Tail recursion and tail calls
621 For example, to enable all the optimization
622 but dead code elimination and inlining, you
623 can use:
624 -O=all,-deadce,-inline
625 The flags that are flagged with [arch-
626 dependency] indicate that the given option
627 if used in combination with Ahead of Time
628 compilation (--aot flag) would produce pre-
629 compiled code that will depend on the cur‐
630 rent CPU and might not be safely moved to
631 another computer.
632
633 The following optimizations are supported
634
635 float32
636 Requests that the runtime performn
637 32-bit floating point operations
638 using only 32-bits. By default the
639 Mono runtime tries to use the high‐
640 est precision available for floating
641 point operations, but while this
642 might render better results, the
643 code might run slower. This
644 options also affects the code gener‐
645 ated by the LLVM backend.
646
647 inline Controls whether the runtime should
648 attempt to inline (the default), or
649 not inline methods invocations
650 --response=FILE Provides a response file, this
651 instructs the Mono command to read other command
652 line options from the specified file, as if the
653 options had been specified on the command line.
654 Useful when you have very long command lines.
655
656 --runtime=VERSION
657 Mono supports different runtime versions.
658 The version used depends on the program
659 that is being run or on its configuration
660 file (named program.exe.config). This
661 option can be used to override such autode‐
662 tection, by forcing a different runtime
663 version to be used. Note that this should
664 only be used to select a later compatible
665 runtime version than the one the program
666 was compiled against. A typical usage is
667 for running a 1.1 program on a 2.0 version:
668 mono --runtime=v2.0.50727 program.exe
669
670 --security, --security=mode
671 Activate the security manager, a currently
672 experimental feature in Mono and it is OFF
673 by default. The new code verifier can be
674 enabled with this option as well.
675
676 Using security without parameters is equiv‐
677 alent as calling it with the "cas" parame‐
678 ter.
679
680 The following modes are supported:
681
682 core-clr
683 Enables the core-clr security sys‐
684 tem, typically used for Moon‐
685 light/Silverlight applications. It
686 provides a much simpler security
687 system than CAS, see
688 http://www.mono-
689 project.com/docs/web/moonlight/ for
690 more details and links to the
691 descriptions of this new system.
692
693 validil
694 Enables the new verifier and per‐
695 forms basic verification for code
696 validity. In this mode, unsafe code
697 and P/Invoke are allowed. This mode
698 provides a better safety guarantee
699 but it is still possible for managed
700 code to crash Mono.
701
702 verifiable
703 Enables the new verifier and per‐
704 forms full verification of the code
705 being executed. It only allows ver‐
706 ifiable code to be executed. Unsafe
707 code is not allowed but P/Invoke is.
708 This mode should not allow managed
709 code to crash mono. The verifica‐
710 tion is not as strict as ECMA 335
711 standard in order to stay compatible
712 with the MS runtime.
713
714 The security system acts on user code: code
715 contained in mscorlib or the global assem‐
716 bly cache is always trusted.
717
718 --server
719 Configures the virtual machine to be better
720 suited for server operations (currently,
721 allows a heavier threadpool initializa‐
722 tion).
723
724 --verify-all
725 Verifies mscorlib and assemblies in the
726 global assembly cache for valid IL, and all
727 user code for IL verifiability.
728
729 This is different from --security's verifi‐
730 able or validil in that these options only
731 check user code and skip mscorlib and
732 assemblies located on the global assembly
733 cache.
734
735 -V, --version
736 Prints JIT version information (system con‐
737 figuration, release number and branch names
738 if available).
739
740
741
743 The following options are used to help when developing a
744 JITed application.
745
746 --debug, --debug=OPTIONS
747 Turns on the debugging mode in the runtime. If an
748 assembly was compiled with debugging information,
749 it will produce line number information for stack
750 traces.
751
752 The optional OPTIONS argument is a comma separated
753 list of debugging options. These options are
754 turned off by default since they generate much
755 larger and slower code at runtime.
756
757 The following options are supported:
758
759 casts Produces a detailed error when throwing a
760 InvalidCastException. This option needs
761 to be enabled as this generates more ver‐
762 bose code at execution time.
763
764 mdb-optimizations
765 Disable some JIT optimizations which are
766 usually only disabled when running inside
767 the debugger. This can be helpful if you
768 want to attach to the running process with
769 mdb.
770
771 gdb Generate and register debugging information
772 with gdb. This is only supported on some
773 platforms, and only when using gdb 7.0 or
774 later.
775
776 --profile[=profiler[:profiler_args]]
777 Loads a profiler module with the given arguments.
778 For more information, see the PROFILING section.
779 This option can be used multiple times; each time
780 will load an additional profiler module.
781
782 --trace[=expression]
783 Shows method names as they are invoked. By
784 default all methods are traced. The trace can be
785 customized to include or exclude methods, classes
786 or assemblies. A trace expression is a comma sep‐
787 arated list of targets, each target can be pre‐
788 fixed with a minus sign to turn off a particular
789 target. The words `program', `all' and `disabled'
790 have special meaning. `program' refers to the
791 main program being executed, and `all' means all
792 the method calls. The `disabled' option is used
793 to start up with tracing disabled. It can be
794 enabled at a later point in time in the program by
795 sending the SIGUSR2 signal to the runtime. Assem‐
796 blies are specified by their name, for example, to
797 trace all calls in the System assembly, use:
798
799 mono --trace=System app.exe
800
801 Classes are specified with the T: prefix. For
802 example, to trace all calls to the System.String
803 class, use:
804
805 mono --trace=T:System.String app.exe
806
807 And individual methods are referenced with the M:
808 prefix, and the standard method notation:
809
810 mono --trace=M:System.Console:WriteLine app.exe
811
812 Exceptions can also be traced, it will cause a
813 stack trace to be printed every time an exception
814 of the specified type is thrown. The exception
815 type can be specified with or without the names‐
816 pace, and to trace all exceptions, specify 'all'
817 as the type name.
818
819 mono --trace=E:System.Exception app.exe
820
821 As previously noted, various rules can be speci‐
822 fied at once:
823
824 mono --trace=T:System.String,T:System.Random app.exe
825
826 You can exclude pieces, the next example traces
827 calls to System.String except for the Sys‐
828 tem.String:Concat method.
829
830 mono --trace=T:System.String,-M:System.String:Concat
831
832 You can trace managed to unmanaged transitions
833 using the wrapper qualifier:
834
835 mono --trace=wrapper app.exe
836
837 Finally, namespaces can be specified using the N:
838 prefix:
839
840 mono --trace=N:System.Xml
841
842
843 --no-x86-stack-align
844 Don't align stack frames on the x86 architecture.
845 By default, Mono aligns stack frames to 16 bytes
846 on x86, so that local floating point and SIMD
847 variables can be properly aligned. This option
848 turns off the alignment, which usually saves one
849 instruction per call, but might result in signifi‐
850 cantly lower floating point and SIMD performance.
851
852 --jitmap
853 Generate a JIT method map in a /tmp/perf-PID.map
854 file. This file is then used, for example, by the
855 perf tool included in recent Linux kernels. Each
856 line in the file has:
857
858 HEXADDR HEXSIZE methodname
859
860 Currently this option is only supported on Linux.
861
863 The maintainer options are only used by those developing
864 the runtime itself, and not typically of interest to run‐
865 time users or developers.
866
867 --bisect=optimization:filename
868 This flag is used by the automatic optimization
869 bug bisector. It takes an optimization flag and a
870 filename of a file containing a list of full
871 method names, one per line. When it compiles one
872 of the methods in the file it will use the opti‐
873 mization given, in addition to the optimizations
874 that are otherwise enabled. Note that if the
875 optimization is enabled by default, you should
876 disable it with `-O`, otherwise it will just apply
877 to every method, whether it's in the file or not.
878
879 --break method
880 Inserts a breakpoint before the method whose name
881 is `method' (namespace.class:methodname). Use
882 `Main' as method name to insert a breakpoint on
883 the application's main method. You can use it
884 also with generics, for example "System.Collec‐
885 tions.Generic.Queue`1:Peek"
886
887 --breakonex
888 Inserts a breakpoint on exceptions. This allows
889 you to debug your application with a native debug‐
890 ger when an exception is thrown.
891
892 --compile name
893 This compiles a method (namespace.name:method‐
894 name), this is used for testing the compiler per‐
895 formance or to examine the output of the code gen‐
896 erator.
897
898 --compileall
899 Compiles all the methods in an assembly. This is
900 used to test the compiler performance or to exam‐
901 ine the output of the code generator
902
903 --graph=TYPE METHOD
904 This generates a postscript file with a graph with
905 the details about the specified method (names‐
906 pace.name:methodname). This requires `dot' and
907 ghostview to be installed (it expects Ghostview to
908 be called "gv"). The following graphs are avail‐
909 able:
910 cfg Control Flow Graph (CFG)
911 dtree Dominator Tree
912 code CFG showing code
913 ssa CFG showing code after SSA translation
914 optcode CFG showing code after IR optimizations
915 Some graphs will only be available if certain
916 optimizations are turned on.
917
918 --ncompile
919 Instruct the runtime on the number of times that
920 the method specified by --compile (or all the
921 methods if --compileall is used) to be compiled.
922 This is used for testing the code generator per‐
923 formance.
924
925 --stats
926 Displays information about the work done by the
927 runtime during the execution of an application.
928
929 --wapi=hps|semdel
930 Perform maintenance of the process shared data.
931 semdel will delete the global semaphore. hps will
932 list the currently used handles.
933
934 -v, --verbose
935 Increases the verbosity level, each time it is
936 listed, increases the verbosity level to include
937 more information (including, for example, a disas‐
938 sembly of the native code produced, code selector
939 info etc.).
940
942 The Mono runtime allows external processes to attach to a
943 running process and load assemblies into the running pro‐
944 gram. To attach to the process, a special protocol is
945 implemented in the Mono.Management assembly.
946
947 With this support it is possible to load assemblies that
948 have an entry point (they are created with -target:exe or
949 -target:winexe) to be loaded and executed in the Mono
950 process.
951
952 The code is loaded into the root domain, and it starts
953 execution on the special runtime attach thread. The
954 attached program should create its own threads and return
955 after invocation.
956
957 This support allows for example debugging applications by
958 having the csharp shell attach to running processes.
959
961 The Mono runtime includes a profiler API that dynamically
962 loaded profiler modules and embedders can use to collect
963 performance-related data about an application. Profiler
964 modules are loaded by passing the --profile command line
965 argument to the Mono runtime.
966
967 Mono ships with a few profiler modules, of which the log
968 profiler is the most feature-rich. It is also the default
969 profiler if the profiler argument is not given, or if
970 default is given. It is possible to write your own pro‐
971 filer modules; see the Custom profilers sub-section.
972
973 Log profiler
974 The log profiler can be used to collect a lot of informa‐
975 tion about a program running in the Mono runtime. This
976 data can be used (both while the process is running and
977 later) to do analyses of the program behavior, determine
978 resource usage, performance issues or even look for par‐
979 ticular execution patterns.
980
981 This is accomplished by logging the events provided by
982 the Mono runtime through the profiler API and periodi‐
983 cally writing them to a file which can later be inspected
984 with the mprof-report(1) tool.
985
986 More information about how to use the log profiler is
987 available on the mono-profilers(1) page, under the LOG
988 PROFILER section, as well as the mprof-report(1) page.
989
990 Coverage profiler
991 The code coverage profiler can instrument a program to
992 help determine which classes, methods, code paths, etc
993 are actually executed. This is most useful when running a
994 test suite to determine whether the tests actually cover
995 the code they're expected to.
996
997 More information about how to use the coverage profiler
998 is available on the mono-profilers(1) page, under the
999 COVERAGE PROFILER section.
1000
1001 AOT profiler
1002 The AOT profiler can help improve startup performance by
1003 logging which generic instantiations are used by a pro‐
1004 gram, which the AOT compiler can then use to compile
1005 those instantiations ahead of time so that they won't
1006 have to be JIT compiled at startup.
1007
1008 More information about how to use the AOT profiler is
1009 available on the mono-profilers(1) page, under the AOT
1010 PROFILER section.
1011
1012 Custom profilers
1013 Custom profiler modules can be loaded in exactly the same
1014 way as the standard modules that ship with Mono. They can
1015 also access the same profiler API to gather all kinds of
1016 information about the code being executed.
1017
1018 For example, to use a third-party profiler called custom,
1019 you would load it like this:
1020
1021 mono --profile=custom program.exe
1022
1023 You could also pass arguments to it:
1024
1025 mono --profile=custom:arg1,arg2=arg3 program.exe
1026
1027 In the above example, Mono will load the profiler from
1028 the shared library called libmono-profiler-custom.so
1029 (name varies based on platform, e.g., libmono-pro‐
1030 filer-custom.dylib on OS X). This profiler module must
1031 be on your dynamic linker library path (LD_LIBRARY_PATH
1032 on most systems, DYLD_LIBRARY_PATH on OS X).
1033
1034 For a sample of how to write your own custom profiler,
1035 look at the samples/profiler/sample.c file in the Mono
1036 source tree.
1037
1039 To debug managed applications, you can use the mdb com‐
1040 mand, a command line debugger.
1041
1042 It is possible to obtain a stack trace of all the active
1043 threads in Mono by sending the QUIT signal to Mono, you
1044 can do this from the command line, like this:
1045
1046 kill -QUIT pid
1047
1048 Where pid is the Process ID of the Mono process you want
1049 to examine. The process will continue running after‐
1050 wards, but its state is not guaranteed.
1051
1052 Important: this is a last-resort mechanism for debugging
1053 applications and should not be used to monitor or probe a
1054 production application. The integrity of the runtime
1055 after sending this signal is not guaranteed and the
1056 application might crash or terminate at any given point
1057 afterwards.
1058
1059 The --debug=casts option can be used to get more detailed
1060 information for Invalid Cast operations, it will provide
1061 information about the types involved.
1062
1063 You can use the MONO_LOG_LEVEL and MONO_LOG_MASK environ‐
1064 ment variables to get verbose debugging output about the
1065 execution of your application within Mono.
1066
1067 The MONO_LOG_LEVEL environment variable if set, the log‐
1068 ging level is changed to the set value. Possible values
1069 are "error", "critical", "warning", "message", "info",
1070 "debug". The default value is "error". Messages with a
1071 logging level greater then or equal to the log level will
1072 be printed to stdout/stderr.
1073
1074 Use "info" to track the dynamic loading of assemblies.
1075
1076 Use the MONO_LOG_MASK environment variable to limit the
1077 extent of the messages you get: If set, the log mask is
1078 changed to the set value. Possible values are "asm"
1079 (assembly loader), "type", "dll" (native library loader),
1080 "gc" (garbage collector), "cfg" (config file loader),
1081 "aot" (precompiler), "security" (e.g. Moonlight CoreCLR
1082 support), "threadpool" (thread pool generic), "io-selec‐
1083 tor" (async socket operations), "io-layer" (I/O layer -
1084 processes, files, sockets, events, semaphores, mutexes
1085 and handles), "io-layer-process", "io-layer-file", "io-
1086 layer-socket", "io-layer-event", "io-layer-semaphore",
1087 "io-layer-mutex", "io-layer-handle" and "all". The
1088 default value is "all". Changing the mask value allows
1089 you to display only messages for a certain component. You
1090 can use multiple masks by comma separating them. For
1091 example to see config file messages and assembly loader
1092 messages set you mask to "asm,cfg".
1093
1094 The following is a common use to track down problems with
1095 P/Invoke:
1096
1097 $ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono glue.exe
1098
1099
1101 If you are using LLDB, you can use the mono.py script to
1102 print some internal data structures with it. To use
1103 this, add this to your $HOME/.lldbinit file:
1104 command script import $PREFIX/lib/mono/lldb/mono.py
1105
1106 Where $PREFIX is the prefix value that you used when you
1107 configured Mono (typically /usr).
1108
1109 Once this is done, then you can inspect some Mono Runtime
1110 data structures, for example:
1111 (lldb) p method
1112
1113 (MonoMethod *) $0 = 0x05026ac0 [mscorlib]System.OutOfMemoryException:.ctor()
1114
1116 Mono's XML serialization engine by default will use a
1117 reflection-based approach to serialize which might be
1118 slow for continuous processing (web service applica‐
1119 tions). The serialization engine will determine when a
1120 class must use a hand-tuned serializer based on a few
1121 parameters and if needed it will produce a customized C#
1122 serializer for your types at runtime. This customized
1123 serializer then gets dynamically loaded into your appli‐
1124 cation.
1125
1126 You can control this with the MONO_XMLSERIALIZER_THS
1127 environment variable.
1128
1129 The possible values are `no' to disable the use of a C#
1130 customized serializer, or an integer that is the minimum
1131 number of uses before the runtime will produce a custom
1132 serializer (0 will produce a custom serializer on the
1133 first access, 50 will produce a serializer on the 50th
1134 use). Mono will fallback to an interpreted serializer if
1135 the serializer generation somehow fails. This behavior
1136 can be disabled by setting the option `nofallback' (for
1137 example: MONO_XMLSERIALIZER_THS=0,nofallback).
1138
1140 GC_DONT_GC
1141 Turns off the garbage collection in Mono. This
1142 should be only used for debugging purposes
1143
1144 HTTP_PROXY
1145 (Also http_proxy) If set, web requests using the
1146 Mono Class Library will be automatically proxied
1147 through the given URL. Not supported on Windows,
1148 Mac OS, iOS or Android. See also NO_PROXY.
1149
1150 LLVM_COUNT
1151 When Mono is compiled with LLVM support, this
1152 instructs the runtime to stop using LLVM after the
1153 specified number of methods are JITed. This is a
1154 tool used in diagnostics to help isolate problems
1155 in the code generation backend. For example
1156 LLVM_COUNT=10 would only compile 10 methods with
1157 LLVM and then switch to the Mono JIT engine.
1158 LLVM_COUNT=0 would disable the LLVM engine alto‐
1159 gether.
1160
1161 MONO_ASPNET_INHIBIT_SETTINGSMAP
1162 Mono contains a feature which allows modifying
1163 settings in the .config files shipped with Mono by
1164 using config section mappers. The mappers and the
1165 mapping rules are defined in the $pre‐
1166 fix/etc/mono/2.0/settings.map file and, option‐
1167 ally, in the settings.map file found in the top-
1168 level directory of your ASP.NET application. Both
1169 files are read by System.Web on application
1170 startup, if they are found at the above locations.
1171 If you don't want the mapping to be performed you
1172 can set this variable in your environment before
1173 starting the application and no action will be
1174 taken.
1175
1176 MONO_ASPNET_WEBCONFIG_CACHESIZE
1177 Mono has a cache of ConfigSection objects for
1178 speeding up WebConfigurationManager queries. Its
1179 default size is 100 items, and when more items are
1180 needed, cache evictions start happening. If evic‐
1181 tions are too frequent this could impose unneces‐
1182 sary overhead, which could be avoided by using
1183 this environment variable to set up a higher cache
1184 size (or to lower memory requirements by decreas‐
1185 ing it).
1186
1187 MONO_CAIRO_DEBUG_DISPOSE
1188 If set, causes Mono.Cairo to collect stack traces
1189 when objects are allocated, so that the finaliza‐
1190 tion/Dispose warnings include information about
1191 the instance's origin.
1192
1193 MONO_CFG_DIR
1194 If set, this variable overrides the default system
1195 configuration directory ($PREFIX/etc). It's used
1196 to locate machine.config file.
1197
1198 MONO_COM
1199 Sets the style of COM interop. If the value of
1200 this variable is "MS" Mono will use string
1201 marhsalling routines from the liboleaut32 for the
1202 BSTR type library, any other values will use the
1203 mono-builtin BSTR string marshalling.
1204
1205 MONO_CONFIG
1206 If set, this variable overrides the default run‐
1207 time configuration file ($PREFIX/etc/mono/config).
1208 The --config command line options overrides the
1209 environment variable.
1210
1211 MONO_CPU_ARCH
1212 Override the automatic cpu detection mechanism.
1213 Currently used only on arm. The format of the
1214 value is as follows:
1215
1216 "armvV [thumb[2]]"
1217
1218 where V is the architecture number 4, 5, 6, 7 and
1219 the options can be currently be "thumb" or
1220 "thumb2". Example:
1221
1222 MONO_CPU_ARCH="armv4 thumb" mono ...
1223
1224
1225 MONO_ARM_FORCE_SOFT_FLOAT
1226 When Mono is built with a soft float fallback on
1227 ARM and this variable is set to "1", Mono will
1228 always emit soft float code, even if a VFP unit is
1229 detected.
1230
1231 MONO_DARWIN_USE_KQUEUE_FSW
1232 Fall back on the kqueue FileSystemWatcher imple‐
1233 mentation in Darwin. The default is the FSEvent
1234 implementation.
1235
1236 MONO_DARWIN_WATCHER_MAXFDS
1237 This is a debugging aid used to force limits on
1238 the kqueue FileSystemWatcher implementation in
1239 Darwin. There is no limit by default.
1240
1241 MONO_DISABLE_MANAGED_COLLATION
1242 If this environment variable is `yes', the runtime
1243 uses unmanaged collation (which actually means no
1244 culture-sensitive collation). It internally dis‐
1245 ables managed collation functionality invoked via
1246 the members of System.Globalization.CompareInfo
1247 class. Collation is enabled by default.
1248
1249 MONO_DISABLE_SHARED_AREA
1250 Unix only: If set, disable usage of shared memory
1251 for exposing performance counters. This means it
1252 will not be possible to both externally read per‐
1253 formance counters from this processes or read
1254 those of external processes.
1255
1256 MONO_DNS
1257 When set, enables the use of a fully managed DNS
1258 resolver instead of the regular libc functions.
1259 This resolver performs much better when multiple
1260 queries are run in parallel.
1261
1262 Note that /etc/nsswitch.conf will be ignored.
1263
1264 MONO_EGD_SOCKET
1265 For platforms that do not otherwise have a way of
1266 obtaining random bytes this can be set to the name
1267 of a file system socket on which an egd or prngd
1268 daemon is listening.
1269
1270 MONO_ENABLE_AIO
1271 If set, tells mono to attempt using native asyn‐
1272 chronous I/O services. If not set, a default
1273 select/poll implementation is used. Currently
1274 epoll and kqueue are supported.
1275
1276 MONO_THREADS_SUSPEND
1277 Selects a mechanism that Mono will use to suspend
1278 threads. May be set to "preemptive", "coop", or
1279 "hybrid". Threads may need to be suspended by the
1280 debugger, or using some .NET threading APIs, and
1281 most commonly when the SGen garbage collector
1282 needs to stop all threads during a critical phase
1283 of garbage collection. Preemptive mode is the
1284 mode that Mono has used historically, going back
1285 to the Boehm days, where the garbage collector
1286 would run at any point and suspend execution of
1287 all threads as required to perform a garbage col‐
1288 lection. The cooperative mode on the other hand
1289 requires the cooperation of all threads to stop at
1290 a safe point. This makes for an easier to debug
1291 garbage collector. As of Mono 4.3.0 it is a work
1292 in progress, and while it works, it has not been
1293 used extensively. This option enables the feature
1294 and allows us to find spots that need to be tuned
1295 for this mode of operation. Hybrid mode is a com‐
1296 bination of the two that retains better compata‐
1297 bility with scenarios where Mono is embedded in
1298 another application: threads that are running man‐
1299 aged code or code that comprises the Mono runtime
1300 will be cooperatively suspended, while threads
1301 running embedder code will be preemptively sus‐
1302 pended.
1303
1304 Alternatively, coop and hybrid mode can be enabled
1305 at compile time by using the --enable-cooperative-
1306 suspend or --enable-hybrid-suspend flags, respec‐
1307 tively, when calling configure. The
1308 MONO_THREADS_SUSPEND environment variable takes
1309 priority over the compiled default.
1310
1311 MONO_ENABLE_COOP_SUSPEND
1312 This environment variable is obsolete, but
1313 retained for backward compatibility. Use
1314 MONO_THREADS_SUSPEND set to "coop" instead. Note
1315 that if configure flags were provided to enable
1316 cooperative or hybrid suspend, this variable is
1317 ignored.
1318
1319 MONO_ENV_OPTIONS
1320 This environment variable allows you to pass com‐
1321 mand line arguments to a Mono process through the
1322 environment. This is useful for example to force
1323 all of your Mono processes to use LLVM or SGEN
1324 without having to modify any launch scripts.
1325
1326 MONO_SDB_ENV_OPTIONS
1327 Used to pass extra options to the debugger agent
1328 in the runtime, as they were passed using --debug‐
1329 ger-agent=.
1330
1331 MONO_EVENTLOG_TYPE
1332 Sets the type of event log provider to use (for
1333 System.Diagnostics.EventLog). Possible values
1334 are:
1335
1336 local[:path]
1337 Persists event logs and entries to the
1338 local file system. The directory in which
1339 to persist the event logs, event sources
1340 and entries can be specified as part of the
1341 value. If the path is not explicitly set,
1342 it defaults to "/var/lib/mono/eventlog" on
1343 unix and "%APPDATA%no\ventlog" on Windows.
1344
1345 win32 Uses the native win32 API to write events
1346 and registers event logs and event sources
1347 in the registry. This is only available
1348 on Windows. On Unix, the directory permis‐
1349 sion for individual event log and event
1350 source directories is set to 777 (with +t
1351 bit) allowing everyone to read and write
1352 event log entries while only allowing
1353 entries to be deleted by the user(s) that
1354 created them.
1355
1356 null Silently discards any events.
1357
1358 The default is "null" on Unix (and versions of
1359 Windows before NT), and "win32" on Windows NT (and
1360 higher).
1361
1362 MONO_EXTERNAL_ENCODINGS
1363 If set, contains a colon-separated list of text
1364 encodings to try when turning externally-generated
1365 text (e.g. command-line arguments or filenames)
1366 into Unicode. The encoding names come from the
1367 list provided by iconv, and the special case
1368 "default_locale" which refers to the current
1369 locale's default encoding.
1370
1371 When reading externally-generated text strings
1372 UTF-8 is tried first, and then this list is tried
1373 in order with the first successful conversion end‐
1374 ing the search. When writing external text (e.g.
1375 new filenames or arguments to new processes) the
1376 first item in this list is used, or UTF-8 if the
1377 environment variable is not set.
1378
1379 The problem with using MONO_EXTERNAL_ENCODINGS to
1380 process your files is that it results in a prob‐
1381 lem: although its possible to get the right file
1382 name it is not necessarily possible to open the
1383 file. In general if you have problems with encod‐
1384 ings in your filenames you should use the "convmv"
1385 program.
1386
1387 MONO_GC_PARAMS
1388 When using Mono with the SGen garbage collector
1389 this variable controls several parameters of the
1390 collector. The variable's value is a comma sepa‐
1391 rated list of words.
1392
1393 max-heap-size=size
1394 Sets the maximum size of the heap. The size
1395 is specified in bytes and must be a power
1396 of two. The suffixes `k', `m' and `g' can
1397 be used to specify kilo-, mega- and giga‐
1398 bytes, respectively. The limit is the sum
1399 of the nursery, major heap and large object
1400 heap. Once the limit is reached the appli‐
1401 cation will receive OutOfMemoryExceptions
1402 when trying to allocate. Not the full
1403 extent of memory set in max-heap-size could
1404 be available to satisfy a single allocation
1405 due to internal fragmentation. By default
1406 heap limits is disabled and the GC will try
1407 to use all available memory.
1408
1409 nursery-size=size
1410 Sets the size of the nursery. The size is
1411 specified in bytes and must be a power of
1412 two. The suffixes `k', `m' and `g' can be
1413 used to specify kilo-, mega- and gigabytes,
1414 respectively. The nursery is the first
1415 generation (of two). A larger nursery will
1416 usually speed up the program but will obvi‐
1417 ously use more memory. The default nursery
1418 size 4 MB.
1419
1420 major=collector
1421 Specifies which major collector to use.
1422 Options are `marksweep' for the Mark&Sweep
1423 collector, `marksweep-conc' for concurrent
1424 Mark&Sweep and `marksweep-conc-par' for
1425 parallel and concurrent Mark&Sweep. The
1426 concurrent Mark&Sweep collector is the
1427 default.
1428
1429 mode=balanced|throughput|pause[:max-pause]
1430 Specifies what should be the garbage col‐
1431 lector's target. The `throughput' mode aims
1432 to reduce time spent in the garbage collec‐
1433 tor and improve application speed, the
1434 `pause' mode aims to keep pause times to a
1435 minimum and it receives the argument max-
1436 pause which specifies the maximum pause
1437 time in milliseconds that is acceptable and
1438 the `balanced' mode which is a general pur‐
1439 pose optimal mode.
1440
1441 soft-heap-limit=size
1442 Once the heap size gets larger than this
1443 size, ignore what the default major collec‐
1444 tion trigger metric says and only allow
1445 four nursery size's of major heap growth
1446 between major collections.
1447
1448 evacuation-threshold=threshold
1449 Sets the evacuation threshold in percent.
1450 This option is only available on the
1451 Mark&Sweep major collectors. The value
1452 must be an integer in the range 0 to 100.
1453 The default is 66. If the sweep phase of
1454 the collection finds that the occupancy of
1455 a specific heap block type is less than
1456 this percentage, it will do a copying col‐
1457 lection for that block type in the next
1458 major collection, thereby restoring occu‐
1459 pancy to close to 100 percent. A value of
1460 0 turns evacuation off.
1461
1462 (no-)lazy-sweep
1463 Enables or disables lazy sweep for the
1464 Mark&Sweep collector. If enabled, the
1465 sweeping of individual major heap blocks is
1466 done piecemeal whenever the need arises,
1467 typically during nursery collections. Lazy
1468 sweeping is enabled by default.
1469
1470 (no-)concurrent-sweep
1471 Enables or disables concurrent sweep for
1472 the Mark&Sweep collector. If enabled, the
1473 iteration of all major blocks to determine
1474 which ones can be freed and which ones have
1475 to be kept and swept, is done concurrently
1476 with the running program. Concurrent
1477 sweeping is enabled by default.
1478
1479 stack-mark=mark-mode
1480 Specifies how application threads should be
1481 scanned. Options are `precise` and `conser‐
1482 vative`. Precise marking allow the collec‐
1483 tor to know what values on stack are refer‐
1484 ences and what are not. Conservative mark‐
1485 ing threats all values as potentially ref‐
1486 erences and leave them untouched. Precise
1487 marking reduces floating garbage and can
1488 speed up nursery collection and allocation
1489 rate, it has the downside of requiring a
1490 significant extra memory per compiled
1491 method. The right option, unfortunately,
1492 requires experimentation.
1493
1494 save-target-ratio=ratio
1495 Specifies the target save ratio for the
1496 major collector. The collector lets a given
1497 amount of memory to be promoted from the
1498 nursery due to minor collections before it
1499 triggers a major collection. This amount is
1500 based on how much memory it expects to
1501 free. It is represented as a ratio of the
1502 size of the heap after a major collection.
1503 Valid values are between 0.1 and 2.0. The
1504 default is 0.5. Smaller values will keep
1505 the major heap size smaller but will trig‐
1506 ger more major collections. Likewise, big‐
1507 ger values will use more memory and result
1508 in less frequent major collections. This
1509 option is EXPERIMENTAL, so it might disap‐
1510 pear in later versions of mono.
1511
1512 default-allowance-ratio=ratio
1513 Specifies the default allocation allowance
1514 when the calculated size is too small. The
1515 allocation allowance is how much memory the
1516 collector let be promoted before triggered
1517 a major collection. It is a ratio of the
1518 nursery size. Valid values are between 1.0
1519 and 10.0. The default is 4.0. Smaller val‐
1520 ues lead to smaller heaps and more frequent
1521 major collections. Likewise, bigger values
1522 will allow the heap to grow faster but use
1523 more memory when it reaches a stable size.
1524 This option is EXPERIMENTAL, so it might
1525 disappear in later versions of mono.
1526
1527 minor=minor-collector
1528 Specifies which minor collector to use.
1529 Options are `simple' which promotes all
1530 objects from the nursery directly to the
1531 old generation, `simple-par' which has same
1532 promotion behavior as `simple' but using
1533 multiple workers and `split' which lets
1534 objects stay longer on the nursery before
1535 promoting.
1536
1537 alloc-ratio=ratio
1538 Specifies the ratio of memory from the
1539 nursery to be use by the alloc space. This
1540 only can only be used with the split minor
1541 collector. Valid values are integers
1542 between 1 and 100. Default is 60.
1543
1544 promotion-age=age
1545 Specifies the required age of an object
1546 must reach inside the nursery before been
1547 promoted to the old generation. This only
1548 can only be used with the split minor col‐
1549 lector. Valid values are integers between
1550 1 and 14. Default is 2.
1551
1552 (no-)cementing
1553 Enables or disables cementing. This can
1554 dramatically shorten nursery collection
1555 times on some benchmarks where pinned
1556 objects are referred to from the major
1557 heap.
1558
1559 allow-synchronous-major
1560 This forbids the major collector from per‐
1561 forming synchronous major collections. The
1562 major collector might want to do a synchro‐
1563 nous collection due to excessive fragmenta‐
1564 tion. Disabling this might trigger Out‐
1565 OfMemory error in situations that would
1566 otherwise not happen.
1567
1568 MONO_GC_DEBUG
1569 When using Mono with the SGen garbage collector
1570 this environment variable can be used to turn on
1571 various debugging features of the collector. The
1572 value of this variable is a comma separated list
1573 of words. Do not use these options in production.
1574
1575 number Sets the debug level to the specified num‐
1576 ber.
1577
1578 print-allowance
1579 After each major collection prints memory
1580 consumption for before and after the col‐
1581 lection and the allowance for the minor
1582 collector, i.e. how much the heap is
1583 allowed to grow from minor collections
1584 before the next major collection is trig‐
1585 gered.
1586
1587 print-pinning
1588 Gathers statistics on the classes whose
1589 objects are pinned in the nursery and for
1590 which global remset entries are added.
1591 Prints those statistics when shutting down.
1592
1593 collect-before-allocs
1594
1595 check-remset-consistency
1596 This performs a remset consistency check at
1597 various opportunities, and also clears the
1598 nursery at collection time, instead of the
1599 default, when buffers are allocated (clear-
1600 at-gc). The consistency check ensures that
1601 there are no major to minor references that
1602 are not on the remembered sets.
1603
1604 mod-union-consistency-check
1605 Checks that the mod-union cardtable is con‐
1606 sistent before each finishing major collec‐
1607 tion pause. This check is only applicable
1608 to concurrent major collectors.
1609
1610 check-mark-bits
1611 Checks that mark bits in the major heap are
1612 consistent at the end of each major collec‐
1613 tion. Consistent mark bits mean that if an
1614 object is marked, all objects that it had
1615 references to must also be marked.
1616
1617 check-nursery-pinned
1618 After nursery collections, and before
1619 starting concurrent collections, check
1620 whether all nursery objects are pinned, or
1621 not pinned - depending on context. Does
1622 nothing when the split nursery collector is
1623 used.
1624
1625 xdomain-checks
1626 Performs a check to make sure that no ref‐
1627 erences are left to an unloaded AppDomain.
1628
1629 clear-at-tlab-creation
1630 Clears the nursery incrementally when the
1631 thread local allocation buffers (TLAB) are
1632 created. The default setting clears the
1633 whole nursery at GC time.
1634
1635 debug-clear-at-tlab-creation
1636 Clears the nursery incrementally when the
1637 thread local allocation buffers (TLAB) are
1638 created, but at GC time fills it with the
1639 byte `0xff`, which should result in a crash
1640 more quickly if `clear-at-tlab-creation`
1641 doesn't work properly.
1642
1643 clear-at-gc
1644 This clears the nursery at GC time instead
1645 of doing it when the thread local alloca‐
1646 tion buffer (TLAB) is created. The default
1647 is to clear the nursery at TLAB creation
1648 time.
1649
1650 disable-minor
1651 Don't do minor collections. If the nursery
1652 is full, a major collection is triggered
1653 instead, unless it, too, is disabled.
1654
1655 disable-major
1656 Don't do major collections.
1657
1658 conservative-stack-mark
1659 Forces the GC to scan the stack conserva‐
1660 tively, even if precise scanning is avail‐
1661 able.
1662
1663 no-managed-allocator
1664 Disables the managed allocator.
1665
1666 check-scan-starts
1667 If set, does a plausibility check on the
1668 scan_starts before and after each collec‐
1669 tion
1670
1671 verify-nursery-at-minor-gc
1672 If set, does a complete object walk of the
1673 nursery at the start of each minor collec‐
1674 tion.
1675
1676 dump-nursery-at-minor-gc
1677 If set, dumps the contents of the nursery
1678 at the start of each minor collection.
1679 Requires verify-nursery-at-minor-gc to be
1680 set.
1681
1682 heap-dump=file
1683 Dumps the heap contents to the specified
1684 file. To visualize the information, use
1685 the mono-heapviz tool.
1686
1687 binary-protocol=file
1688 Outputs the debugging output to the speci‐
1689 fied file. For this to work, Mono needs
1690 to be compiled with the BINARY_PROTOCOL
1691 define on sgen-gc.c. You can then use
1692 this command to explore the output
1693 sgen-grep-binprot 0x1234 0x5678 < file
1694
1695 nursery-canaries
1696 If set, objects allocated in the nursery
1697 are suffixed with a canary (guard) word,
1698 which is checked on each minor collection.
1699 Can be used to detect/debug heap corruption
1700 issues.
1701
1702
1703 do-not-finalize(=classes)
1704 If enabled, finalizers will not be run.
1705 Everything else will be unaffected: final‐
1706 izable objects will still be put into the
1707 finalization queue where they survive until
1708 they're scheduled to finalize. Once
1709 they're not in the queue anymore they will
1710 be collected regularly. If a list of
1711 comma-separated class names is given, only
1712 objects from those classes will not be
1713 finalized.
1714
1715
1716 log-finalizers
1717 Log verbosely around the finalization
1718 process to aid debugging.
1719
1720 MONO_GAC_PREFIX
1721 Provides a prefix the runtime uses to look for
1722 Global Assembly Caches. Directories are separated
1723 by the platform path separator (colons on unix).
1724 MONO_GAC_PREFIX should point to the top directory
1725 of a prefixed install. Or to the directory pro‐
1726 vided in the gacutil /gacdir command. Example:
1727 /home/username/.mono:/usr/local/mono/
1728
1729 MONO_IOMAP
1730 Enables some filename rewriting support to assist
1731 badly-written applications that hard-code Windows
1732 paths. Set to a colon-separated list of "drive"
1733 to strip drive letters, or "case" to do case-
1734 insensitive file matching in every directory in a
1735 path. "all" enables all rewriting methods.
1736 (Backslashes are always mapped to slashes if this
1737 variable is set to a valid option).
1738 For example, this would work from the shell:
1739
1740 MONO_IOMAP=drive:case
1741 export MONO_IOMAP
1742
1743 If you are using mod_mono to host your web appli‐
1744 cations, you can use the MonoIOMAP directive
1745 instead, like this:
1746
1747 MonoIOMAP <appalias> all
1748
1749 See mod_mono(8) for more details.
1750
1751 MONO_LLVM
1752 When Mono is using the LLVM code generation back‐
1753 end you can use this environment variable to pass
1754 code generation options to the LLVM compiler.
1755
1756 MONO_MANAGED_WATCHER
1757 If set to "disabled", System.IO.FileSystemWatcher
1758 will use a file watcher implementation which
1759 silently ignores all the watching requests. If
1760 set to any other value, System.IO.FileSys‐
1761 temWatcher will use the default managed implemen‐
1762 tation (slow). If unset, mono will try to use ino‐
1763 tify, FAM, Gamin, kevent under Unix systems and
1764 native API calls on Windows, falling back to the
1765 managed implementation on error.
1766
1767 MONO_MESSAGING_PROVIDER
1768 Mono supports a plugin model for its implementa‐
1769 tion of System.Messaging making it possible to
1770 support a variety of messaging implementations
1771 (e.g. AMQP, ActiveMQ). To specify which messaging
1772 implementation is to be used the evironement vari‐
1773 able needs to be set to the full class name for
1774 the provider. E.g. to use the RabbitMQ based AMQP
1775 implementation the variable should be set to:
1776
1777 Mono.Messaging.RabbitMQ.RabbitMQMessagingProvider,Mono.Messaging.RabbitMQ
1778
1779 MONO_NO_SMP
1780 If set causes the mono process to be bound to a single processor. This may be
1781 useful when debugging or working around race conditions.
1782
1783 MONO_NO_TLS
1784 Disable inlining of thread local accesses. Try setting this if you get a segfault
1785 early on in the execution of mono.
1786
1787 MONO_PATH
1788 Provides a search path to the runtime where to look for library
1789 files. This is a tool convenient for debugging applications, but
1790 should not be used by deployed applications as it breaks the assembly
1791 loader in subtle ways.
1792 Directories are separated by the platform path separator (colons on unix). Example:
1793 /home/username/lib:/usr/local/mono/lib
1794 Relative paths are resolved based on the launch-time current directory.
1795 Alternative solutions to MONO_PATH include: installing libraries into
1796 the Global Assembly Cache (see gacutil(1)) or having the dependent
1797 libraries side-by-side with the main executable.
1798 For a complete description of recommended practices for application
1799 deployment, see
1800 http://www.mono-project.com/docs/getting-started/application-deployment/
1801
1802 MONO_SHARED_DIR
1803 If set its the directory where the ".wapi" handle state is stored.
1804 This is the directory where the Windows I/O Emulation layer stores its
1805 shared state data (files, events, mutexes, pipes). By default Mono
1806 will store the ".wapi" directory in the users's home directory.
1807
1808 MONO_SHARED_HOSTNAME
1809 Uses the string value of this variable as a replacement for the host name when
1810 creating file names in the ".wapi" directory. This helps if the host name of
1811 your machine is likely to be changed when a mono application is running or if
1812 you have a .wapi directory shared among several different computers.
1813 Mono typically uses the hostname to create the files that are used to
1814 share state across multiple Mono processes. This is done to support
1815 home directories that might be shared over the network.
1816
1817 MONO_STRICT_IO_EMULATION
1818 If set, extra checks are made during IO operations. Currently, this
1819 includes only advisory locks around file writes.
1820
1821 MONO_TLS_PROVIDER
1822 This environment variable controls which TLS/SSL provider Mono will
1823 use. The options are usually determined by the operating system where
1824 Mono was compiled and the configuration options that were used for
1825 it.
1826
1827 default
1828 Uses the default TLS stack that the Mono runtime was configured with.
1829 Usually this is configured to use Apple's SSL stack on Apple
1830 platforms, and Boring SSL on other platforms.
1831
1832 apple Forces the use of the Apple SSL stack, only works on Apple platforms.
1833
1834 btls Forces the use of the BoringSSL stack. See
1835 https://opensource.google.com/projects/boringssl for more information
1836 about this stack.
1837
1838 legacy This is the old Mono stack, which only supports SSL and TLS up to
1839 version 1.0. It is deprecated and will be removed in the future.
1840
1841 MONO_TLS_SESSION_CACHE_TIMEOUT
1842 The time, in seconds, that the SSL/TLS session cache will keep it's entry to
1843 avoid a new negotiation between the client and a server. Negotiation are very
1844 CPU intensive so an application-specific custom value may prove useful for
1845 small embedded systems.
1846 The default is 180 seconds.
1847
1848 MONO_THREADS_PER_CPU
1849 The minimum number of threads in the general threadpool will be
1850 MONO_THREADS_PER_CPU * number of CPUs. The default value for this
1851 variable is 1.
1852
1853 MONO_XMLSERIALIZER_THS
1854 Controls the threshold for the XmlSerializer to produce a custom
1855 serializer for a given class instead of using the Reflection-based
1856 interpreter. The possible values are `no' to disable the use of a
1857 custom serializer or a number to indicate when the XmlSerializer
1858 should start serializing. The default value is 50, which means that
1859 the a custom serializer will be produced on the 50th use.
1860
1861 MONO_X509_REVOCATION_MODE
1862 Sets the revocation mode used when validating a X509 certificate chain (https,
1863 ftps, smtps...). The default is 'nocheck', which performs no revocation check
1864 at all. The other possible values are 'offline', which performs CRL check (not
1865 implemented yet) and 'online' which uses OCSP and CRL to verify the revocation
1866 status (not implemented yet).
1867
1868 NO_PROXY
1869 (Also no_proxy) If both HTTP_PROXY and NO_PROXY are
1870 set, NO_PROXY will be treated as a comma-separated list of "bypass" domains
1871 which will not be sent through the proxy. Domains in NO_PROXY may contain
1872 wildcards, as in "*.mono-project.com" or "build????.local". Not supported on
1873 Windows, Mac OS, iOS or Android.
1874
1876 MONO_ASPNET_NODELETE
1877 If set to any value, temporary source files gener‐
1878 ated by ASP.NET support classes will not be
1879 removed. They will be kept in the user's temporary
1880 directory.
1881
1882 MONO_DEBUG
1883 If set, enables some features of the runtime use‐
1884 ful for debugging. This variable should contain a
1885 comma separated list of debugging options. Cur‐
1886 rently, the following options are supported:
1887
1888 align-small-structs
1889 Enables small structs alignment to 4/8
1890 bytes.
1891
1892 arm-use-fallback-tls
1893 When this option is set on ARM, a fallback
1894 thread local store will be used instead of
1895 the default fast thread local storage prim‐
1896 itives.
1897
1898 break-on-unverified
1899 If this variable is set, when the Mono VM
1900 runs into a verification problem, instead
1901 of throwing an exception it will break into
1902 the debugger. This is useful when debug‐
1903 ging verifier problems
1904
1905 casts This option can be used to get more
1906 detailed information from InvalidCast
1907 exceptions, it will provide information
1908 about the types involved.
1909
1910 check-pinvoke-callconv
1911 This option causes the runtime to check for
1912 calling convention mismatches when using
1913 pinvoke, i.e. mixing cdecl/stdcall. It only
1914 works on windows. If a mismatch is
1915 detected, an ExecutionEngineException is
1916 thrown.
1917
1918 collect-pagefault-stats
1919 Collects information about pagefaults.
1920 This is used internally to track the number
1921 of page faults produced to load metadata.
1922 To display this information you must use
1923 this option with "--stats" command line
1924 option.
1925
1926 debug-domain-unload
1927 When this option is set, the runtime will
1928 invalidate the domain memory pool instead
1929 of destroying it.
1930
1931 disable_omit_fp
1932 Disables a compiler optimization where the
1933 frame pointer is omitted from the stack.
1934 This optimization can interact badly with
1935 debuggers.
1936
1937 dont-free-domains
1938 This is an Optimization for multi-AppDomain
1939 applications (most commonly ASP.NET appli‐
1940 cations). Due to internal limitations
1941 Mono, Mono by default does not use typed
1942 allocations on multi-appDomain applications
1943 as they could leak memory when a domain is
1944 unloaded. Although this is a fine default,
1945 for applications that use more than on App‐
1946 Domain heavily (for example, ASP.NET appli‐
1947 cations) it is worth trading off the small
1948 leaks for the increased performance (addi‐
1949 tionally, since ASP.NET applications are
1950 not likely going to unload the application
1951 domains on production systems, it is worth
1952 using this feature).
1953
1954 dyn-runtime-invoke
1955 Instructs the runtime to try to use a
1956 generic runtime-invoke wrapper instead of
1957 creating one invoke wrapper.
1958
1959 explicit-null-checks
1960 Makes the JIT generate an explicit NULL
1961 check on variable dereferences instead of
1962 depending on the operating system to raise
1963 a SIGSEGV or another form of trap event
1964 when an invalid memory location is
1965 accessed.
1966
1967 gdb Equivalent to setting the MONO_XDEBUG vari‐
1968 able, this emits symbols into a shared
1969 library as the code is JITed that can be
1970 loaded into GDB to inspect symbols.
1971
1972 gen-seq-points
1973 Automatically generates sequence points
1974 where the IL stack is empty. These are
1975 places where the debugger can set a break‐
1976 point.
1977
1978 no-compact-seq-points
1979 Unless the option is used, the runtime gen‐
1980 erates sequence points data that maps
1981 native offsets to IL offsets. Sequence
1982 point data is used to display IL offset in
1983 stacktraces. Stacktraces with IL offsets
1984 can be symbolicated using mono-symbolicate
1985 tool.
1986
1987 handle-sigint
1988 Captures the interrupt signal (Control-C)
1989 and displays a stack trace when pressed.
1990 Useful to find out where the program is
1991 executing at a given point. This only dis‐
1992 plays the stack trace of a single thread.
1993
1994 init-stacks
1995 Instructs the runtime to initialize the
1996 stack with some known values (0x2a on
1997 x86-64) at the start of a method to assist
1998 in debuggin the JIT engine.
1999
2000 keep-delegates
2001 This option will leak delegate trampolines
2002 that are no longer referenced as to present
2003 the user with more information about a del‐
2004 egate misuse. Basically a delegate
2005 instance might be created, passed to unman‐
2006 aged code, and no references kept in man‐
2007 aged code, which will garbage collect the
2008 code. With this option it is possible to
2009 track down the source of the problems.
2010
2011 no-gdb-backtrace
2012 This option will disable the GDB backtrace
2013 emitted by the runtime after a SIGSEGV or
2014 SIGABRT in unmanaged code.
2015
2016 partial-sharing
2017 When this option is set, the runtime can
2018 share generated code between generic types
2019 effectively reducing the amount of code
2020 generated.
2021
2022 reverse-pinvoke-exceptions
2023 This option will cause mono to abort with a
2024 descriptive message when during stack
2025 unwinding after an exception it reaches a
2026 native stack frame. This happens when a
2027 managed delegate is passed to native code,
2028 and the managed delegate throws an excep‐
2029 tion. Mono will normally try to unwind the
2030 stack to the first (managed) exception han‐
2031 dler, and it will skip any native stack
2032 frames in the process. This leads to unde‐
2033 fined behaviour (since mono doesn't know
2034 how to process native frames), leaks, and
2035 possibly crashes too.
2036
2037 single-imm-size
2038 This guarantees that each time managed code
2039 is compiled the same instructions and reg‐
2040 isters are used, regardless of the size of
2041 used values.
2042
2043 soft-breakpoints
2044 This option allows using single-steps and
2045 breakpoints in hardware where we cannot do
2046 it with signals.
2047
2048 suspend-on-native-crash
2049 This option will suspend the program when a
2050 native crash occurs (SIGSEGV, SIGILL, ...).
2051 This is useful for debugging crashes which
2052 do not happen under gdb, since a live
2053 process contains more information than a
2054 core file.
2055
2056 suspend-on-sigsegv
2057 Same as suspend-on-native-crash.
2058
2059 suspend-on-exception
2060 This option will suspend the program when
2061 an exception occurs.
2062
2063 suspend-on-unhandled
2064 This option will suspend the program when
2065 an unhandled exception occurs.
2066
2067 thread-dump-dir=DIR
2068 Use DIR for storage thread dumps created by
2069 SIGQUIT.
2070
2071 verbose-gdb
2072 Make gdb output on native crashes more ver‐
2073 bose.
2074
2075 MONO_LOG_LEVEL
2076 The logging level, possible values are `error',
2077 `critical', `warning', `message', `info' and
2078 `debug'. See the DEBUGGING section for more
2079 details.
2080
2081 MONO_LOG_MASK
2082 Controls the domain of the Mono runtime that log‐
2083 ging will apply to. If set, the log mask is
2084 changed to the set value. Possible values are
2085 "asm" (assembly loader), "type", "dll" (native
2086 library loader), "gc" (garbage collector), "cfg"
2087 (config file loader), "aot" (precompiler), "secu‐
2088 rity" (e.g. Moonlight CoreCLR support) and "all".
2089 The default value is "all". Changing the mask
2090 value allows you to display only messages for a
2091 certain component. You can use multiple masks by
2092 comma separating them. For example to see config
2093 file messages and assembly loader messages set you
2094 mask to "asm,cfg".
2095
2096 MONO_LOG_DEST
2097 Controls where trace log messages are written. If
2098 not set then the messages go to stdout. If set,
2099 the string either specifies a path to a file that
2100 will have messages appended to it, or the string
2101 "syslog" in which case the messages will be writ‐
2102 ten to the system log. Under Windows, this is
2103 simulated by writing to a file called "mono.log".
2104 MONO_LOG_HEADER Controls whether trace log mes‐
2105 sages not directed to syslog have the id, time‐
2106 stamp, and pid as the prefix to the log message.
2107 To enable a header this environment variable need
2108 just be non-null.
2109
2110 MONO_TRACE
2111 Used for runtime tracing of method calls. The for‐
2112 mat of the comma separated trace options is:
2113
2114 [-]M:method name
2115 [-]N:namespace
2116 [-]T:class name
2117 [-]all
2118 [-]program
2119 disabled Trace output off upon start.
2120
2121 You can toggle trace output on/off sending a
2122 SIGUSR2 signal to the program.
2123
2124 MONO_TRACE_LISTENER
2125 If set, enables the System.Diagnostics.Default‐
2126 TraceListener, which will print the output of the
2127 System.Diagnostics Trace and Debug classes. It
2128 can be set to a filename, and to Console.Out or
2129 Console.Error to display output to standard output
2130 or standard error, respectively. If it's set to
2131 Console.Out or Console.Error you can append an
2132 optional prefix that will be used when writing
2133 messages like this: Console.Error:MyProgramName.
2134 See the System.Diagnostics.DefaultTraceListener
2135 documentation for more information.
2136
2137 MONO_WCF_TRACE
2138 This eases WCF diagnostics functionality by simply
2139 outputs all log messages from WCF engine to "std‐
2140 out", "stderr" or any file passed to this environ‐
2141 ment variable. The log format is the same as usual
2142 diagnostic output.
2143
2144 MONO_XEXCEPTIONS
2145 This throws an exception when a X11 error is
2146 encountered; by default a message is displayed but
2147 execution continues
2148
2149 MONO_XMLSERIALIZER_DEBUG
2150 Set this value to 1 to prevent the serializer from
2151 removing the temporary files that are created for
2152 fast serialization; This might be useful when
2153 debugging.
2154
2155 MONO_XSYNC
2156 This is used in the System.Windows.Forms implemen‐
2157 tation when running with the X11 backend. This is
2158 used to debug problems in Windows.Forms as it
2159 forces all of the commands send to X11 server to
2160 be done synchronously. The default mode of oper‐
2161 ation is asynchronous which makes it hard to iso‐
2162 late the root of certain problems.
2163
2164 MONO_XDEBUG
2165 When the the MONO_XDEBUG env var is set, debugging
2166 info for JITted code is emitted into a shared
2167 library, loadable into gdb. This enables, for
2168 example, to see managed frame names on gdb back‐
2169 traces.
2170
2171 MONO_VERBOSE_METHOD
2172 Enables the maximum JIT verbosity for the speci‐
2173 fied method. This is very helpfull to diagnose a
2174 miscompilation problems of a specific method.
2175 This can be a semicolon-separated list of method
2176 names to match. If the name is simple, this
2177 applies to any method with that name, otherwise
2178 you can use a mono method description (see the
2179 section METHOD DESCRIPTIONS).
2180
2181 MONO_JIT_DUMP_METHOD
2182 Enables sending of the JITs intermediate represen‐
2183 tation for a specified method to the IdealGraphVi‐
2184 sualizer tool.
2185
2186 MONO_VERBOSE_HWCAP
2187 If set, makes the JIT output information about
2188 detected CPU features (such as SSE, CMOV, FCMOV,
2189 etc) to stdout.
2190
2191 MONO_CONSERVATIVE_HWCAP
2192 If set, the JIT will not perform any hardware
2193 capability detection. This may be useful to pin‐
2194 point the cause of JIT issues. This is the default
2195 when Mono is built as an AOT cross compiler, so
2196 that the generated code will run on most hardware.
2197
2199 If you want to use Valgrind, you will find the file
2200 `mono.supp' useful, it contains the suppressions for the
2201 GC which trigger incorrect warnings. Use it like this:
2202 valgrind --suppressions=mono.supp mono ...
2203
2205 On some platforms, Mono can expose a set of DTrace probes
2206 (also known as user-land statically defined, USDT
2207 Probes).
2208
2209 They are defined in the file `mono.d'.
2210
2211 ves-init-begin, ves-init-end
2212 Begin and end of runtime initialization.
2213
2214 method-compile-begin, method-compile-end
2215 Begin and end of method compilation. The probe
2216 arguments are class name, method name and signa‐
2217 ture, and in case of method-compile-end success or
2218 failure of compilation.
2219
2220 gc-begin, gc-end
2221 Begin and end of Garbage Collection.
2222
2223 To verify the availability of the probes, run:
2224 dtrace -P mono'$target' -l -c mono
2225
2227 Mono's Ping implementation for detecting network reacha‐
2228 bility can create the ICMP packets itself without requir‐
2229 ing the system ping command to do the work. If you want
2230 to enable this on Linux for non-root users, you need to
2231 give the Mono binary special permissions.
2232
2233 As root, run this command:
2234 # setcap cap_net_raw=+ep /usr/bin/mono
2235
2237 On Unix assemblies are loaded from the installation lib
2238 directory. If you set `prefix' to /usr, the assemblies
2239 will be located in /usr/lib. On Windows, the assemblies
2240 are loaded from the directory where mono and mint live.
2241
2242 ~/.mono/aot-cache
2243 The directory for the ahead-of-time compiler
2244 demand creation assemblies are located.
2245
2246 /etc/mono/config, ~/.mono/config
2247 Mono runtime configuration file. See the mono-
2248 config(5) manual page for more information.
2249
2250 ~/.config/.mono/certs, /usr/share/.mono/certs
2251 Contains Mono certificate stores for users /
2252 machine. See the certmgr(1) manual page for more
2253 information on managing certificate stores and the
2254 mozroots(1) page for information on how to import
2255 the Mozilla root certificates into the Mono cer‐
2256 tificate store.
2257
2258 ~/.mono/assemblies/ASSEMBLY/ASSEMBLY.config
2259 Files in this directory allow a user to customize
2260 the configuration for a given system assembly, the
2261 format is the one described in the mono-config(5)
2262 page.
2263
2264 ~/.config/.mono/keypairs, /usr/share/.mono/keypairs
2265 Contains Mono cryptographic keypairs for users /
2266 machine. They can be accessed by using a CspParam‐
2267 eters object with DSACryptoServiceProvider and
2268 RSACryptoServiceProvider classes.
2269
2270 ~/.config/.isolatedstorage, ~/.local/share/.isolatedstor‐
2271 age, /usr/share/.isolatedstorage
2272 Contains Mono isolated storage for non-roaming
2273 users, roaming users and local machine. Isolated
2274 storage can be accessed using the classes from the
2275 System.IO.IsolatedStorage namespace.
2276
2277 <assembly>.config
2278 Configuration information for individual assem‐
2279 blies is loaded by the runtime from side-by-side
2280 files with the .config files, see the
2281 http://www.mono-project.com/Config for more infor‐
2282 mation.
2283
2284 Web.config, web.config
2285 ASP.NET applications are configured through these
2286 files, the configuration is done on a per-direc‐
2287 tory basis. For more information on this subject
2288 see the http://www.mono-project.com/Config_sys‐
2289 tem.web page.
2290
2292 Mailing lists are listed at the http://www.mono-
2293 project.com/community/help/mailing-lists/
2294
2296 http://www.mono-project.com
2297
2299 certmgr(1), cert-sync(1), csharp(1), gacutil(1), mcs(1),
2300 monodis(1), mono-config(5), mono-profilers(1),
2301 mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8)
2302
2303 For more information on AOT: http://www.mono-
2304 project.com/docs/advanced/aot/
2305
2306 For ASP.NET-related documentation, see the xsp(1) manual
2307 page
2308
2309
2310
2311 Mono(mono)