[Mono-dev] [PATCH] MONO_IOMAP reporting option - string allocation locations

Miguel de Icaza miguel at novell.com
Sat Nov 28 01:12:03 EST 2009


Hello Marek,

      I think the idea is very useful, but I would like to see this  
implemented as a loadable profiler.

      We could make an alias to load other modules like --module that  
would just be an alias to this feature if you think that the profiler  
association is too negative.

On Nov 26, 2009, at 7:08 PM, Marek Habersack wrote:

> Hello everybody,
>
> 	Attached is an update to the original code I posted last week. The  
> update adds support for reporting string allocation locations. It is  
> useful with large code base where strings may be created in one  
> location but used in many others. The code adds a new internal  
> function which does the job of backtrace (3) but supports mono JIT.  
> It's basically a lighter version of mono_jit_walk_stack which was  
> too heavy for this purpose. The code needs to record stack location  
> for each and every string allocated in the application and the  
> runtime only to store it for later use when IOMAP kicks in. Doing  
> that with mono_stack_walk rendered Mono many times slower and made  
> debugging the application virtually impossible. The patch makes  
> execution just slightly slower than usual. The reporting code uses  
> simple heuristics to select the possible string allocation location  
> - it attempts to ignore all methods from assemblies installed in  
> GAC, from corlib and, should the two checks fail, from a list of  
> assemblies and classes to ignore. This is done based on the premise  
> that the Mono runtime and class libraries are case-sensitive and  
> don't have the problem some applications might have (there's  
> actually an instance where that assumption is incorrect - in  
> System.Web we check for existence of web.config, Web.config and  
> Web.Config - but it's intended :)). The results of the selection  
> algorithm might not always be accurate, but they should be close  
> enough to aid the developer to spot the location where string was  
> allocated.
> 	Please review and let me know if I can commit.
>
> marek
> <iomap-report.diff>_______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list