[Mono-list] Garbage collection and memory usage

Miguel de Icaza miguel at novell.com
Tue Apr 18 21:04:52 EDT 2006


Hello,

>     Thanks for this test case, I can reproduce the leak problem.  We
> will investigate this issue.

We looked at the problem, and it boils down to the fact that Mono does
not have a compacting GC.

This test is generating some very large datasets that then get their
viewstate serialized, it is something that Microsoft explicitly states
is a bad idea.

The viewstate gets serialized for all of those rows and it produces a 2
megabyte viewstate (it does this on Windows too), which means that every
page contains 2 megabytes of a "hidden" field in addition to the page
contents.

In Mono, the lack of a compacting GC makes the situation worse as the
heap gets fragmented and we create a number of copies of the string and
the viewstate as we process things which make things worse.

We have a small solution in place, and we have a fantastic idea on how
to eliminate all of the in-memory copies of the viewstate which we will
deploy later, but the current coding pattern that you are using is not
ideal and you should look into using a different model (in Mono or
Microsoft.NET)

Miguel


More information about the Mono-list mailing list