[Mono-dev] [PATCH] MONO_IOMAP reporting option - string allocation locations
Marek Habersack
grendel at twistedcode.net
Thu Nov 26 19:08:52 EST 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iomap-report.diff
Type: text/x-patch
Size: 26669 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091127/3192d1f5/attachment-0001.bin
More information about the Mono-devel-list
mailing list