These instructions are for building mono with Linear CIL on Linux - they should be easily adapted to a windows installation.
To build mono with Linear CIL, large heaps, and pthreads, work through the following procedure:
1. As your opensim user, and typically in his/her home directory, create a working directory and gather the sources into it from the mono svn site (for reference purposes, the URL of that site is
http://mono-project.com/AnonSVN), as follows:
svn co
svn://anonsvn.mono-project.com/source/trunk/mcs svn co
svn://anonsvn.mono-project.com/source/trunk/mono svn co
svn://anonsvn.mono-project.com/source/trunk/libgdiplus2. visit each of the base source directories obtained via svn. Read the README/INSTALL file. Each of the source trees has to be configured but each may use either configure, autoconf, or bootstrap to prepare the source for compiling. Configure the sources as directed by the README/INSTALL for each of the three source trees. This will produce 'configure' scripts which must be run for each source tree. Once this has been done, execute the configure scripts with the folowing switches:
sh autogen.sh
./configure --prefix=/home/user/bin/mono23a --with-tls=pthread --with-large-heap=yes
Be sure to replace the --prefix value with a target directory in your opensim user's home directory..
3. Once configured, the mono must be built. This is accomplished by issuing the 'make' command in the same directories where configuration was completed.
4. After successfully accomplishing a 'make' for each of the source trees, you are ready for 'make install'. Do the mono/mcs first.
5. Once the install process is successfully completed, put the target directory you supplied via the --prefix switch in the opensim user's path. Be sure to get this right or your shiny new mono will go unused.
Rebuild opensim and start it up with the new mono. The gains are a smaller binary (by ~10%), something close to a 10% increase in speed, and a much tighter and more stable garbage collection cycle.
*** Note: it is highly recommended to leave any mono installed by your distro intact and keep the SVN mono well corralled and used by opensim only, as the mono SVN is a developement branch and may cause issues if used by things that depend on the system provided mono revision.
Good Luck

Hiro/daTwitch
