Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
My program has been terminated, the exception information is "Error: Garbage collector could not allocate 524288 bytes of memory for major heap section".
Can I modify the source code?
souce:/ metadata / sgen-memory-governor.c
sgen_assert_memory_alloc (void *ptr, size_t requested_size, const char *assert_description)
if (ptr || !assert_description)
fprintf (stderr, "Error: Garbage collector could not allocate %zu bytes of memory for %s.\n", requested_size, assert_description);
// exit (1);
I want to get more detailed information about how to do it?
Mono JIT compiler version 3.0.6
OS: CentOs 6.3
I am hoping to get the OutOfMemoryException, how to do it?
Our OutOfMemoryException generation is not very good, we usually assert instead of throwing it.
You can force a heap size limit so you can get a nicer OOM exception. See mono's man page for further information.
How do I know the modified configuration has been successful?
Enable GC logging by passing MONO_LOG_LEVEL=debug.
What you did is not set a max heap size, but use the fixed heap collector. You should use the max-heap-size option instead.
Ah, I did not find this parameter in the mono's man page.
I set "max-heap-size" to how much?
PC-Memory is 8G.
Se to how much you think your app need. You can use k, m and g suffixes when specifying sizes.
Can you still reproduce this bug with latest version of mono? Please feel free to reopen if that is still the case. Thank you.