COM/Interop Issues Update

After the last patch, all was quiet for two months. Then some complaints started coming in. One centers around Oracle drivers. This was the classic failure. A memory leak in a closed ASP session caused a Catastrophic failures around the Oracle drivers. Don’t get me wrong, these drivers can cause their own problems too. The other problem is a general slowness after time. Where the app takes 5 times longer to use. Restarting IIS restores the speed, but repeating this every day it far from an optimal solution.

Since the version 1 patch there is a new version of the app. It has the same fixes as the patch. In fact, it was the test bed for the code that was moved into the patch. The enhanced code started in version 2, copied and modified to a patch version 1, and then copied back to version 2. It was further modified in version 2 to remove lots of common COM calls.

The fix for the patch was to abstract the COM objects into a .Net object. Where a COM object was created, used, and discarded a .Net object is called, which makes (if necessary) a single, reusable COM object, uses it, and discards it when the app is disposed. Instead of 50 or more create/dispose commands there is 1 pair. I highly recommend this practice when accessing COM objects from .Net.

There are some differences between the patch and version 2. I don’t remember them all. As with most patches the attention was on making only the necessary changes to resolve the defect. Version 2 made additional changes for ease of maintenance, readability, and completeness.

With the slowness issue around the patched version. Version 2 has been receiving performance measurement attention. And it seems to have similar issues. At 1.5 hr it begins slowing. At the end of 10 hr it is 7 times slower than when it started.

Something happens during the running, which acts like sand in the gears. Nothing in the standard IIS/Machine metrics stands out. Memory holds steady, disk usage holds, processor usage holds, blah-blah-blah holds. Perhaps an additional test with .Net metrics being recorded will detect something.

I’m exceedingly pleased that the previous errors no longer occur. If we can just jostle .Net the right way to knock the sand loose, new patches can be issued and both versions fixed.

Leave a Reply

You must be logged in to post a comment.