Memory Leak?



When the model in Solution Builder gets large (about 100 elements), and when the number of text templates to generate is high (about 2 per element), the time to generate is not linearly related to number of text templates.

It appears that the time to generate is more like the square of the number of files to generate.

Worse than that, it appears from observation of memory usage (Task Manager) that during the generation process (which can take to 30mins!), the memory of the devenv.exe process steadily rises until it reaches a limit of 3GB, at which point the generation errors out, and visual studio becomes unstable and ultimately locks up!


It turns out that no matter how much memory is available to the machine (even if > 3GB) Visual Studio is 32bit process and the maximum amount of memory that process can use is 3GB. The generation is hitting that limit.


It appears that the generation of text templates is consuming memory and not releasing it after each file is generated. For if it was, then the memory would not continue to rise throughout the process. Perhaps garbage collection is not occurring during that time, or memory is not released.