Archive for the ‘MOSS Arch & Dev’ Category

Have you ever handled some third-party web part which creates SPsite using object model, while suffering some performance/run out of memory?

Here is something helps to identify memory leak/Dispose issues:

1.Check if the application pool recycle frequently, especially under heavy load. For a 2 GB or more of RAM, Configuring app pool to recycle around 1 GM gives best result. But in the real world this changes case by case: it worths to expriment to see what settings works best for the environment. Sometimes you might need add another app pool to balance the memory usage.

2. If using third party codes to generate object/component, make sure they are managed code (.Net code), and that is not even enough, if object is created using some small “wrapper”, the wrapper might create unmanaged objects, which can have MB size or even bigger, and then Garbage collection would not enough.¬†Under heavy user loads, this cause big issue, and developer has to use Dispose() function to clean the trash after calling the object/function. To help to see how Dispose() function works, using reflector to take a look.

Using memory monitor is a way to indentify which code part has this kind of problem, combine with Unit test and VSTS tool .


Read Full Post »