This was a straight forward issue that I worked on a short period of time ago and thought that it was worthy of posting the results.
The issue that we were encountering was with a service application that a customer had written that was doing a lot of repeated calls to some Exchange mailboxes using CDOEX. Over time, as any good leaky application will, the memory being used by this application began to grow and grow. I bring this issue up since it could be something that you might encounter, since it doesn't take much to expose the problem. It just so happens that this can occur with some really simple CDOEX code. For this problem to occur you really only need to be using code similar to the following:
Dim Conn As ADODB.ConnectionDim objAppt As CDO.AppointmentDim i As Long For i = 1 To 50000 Set objAppt = New CDO.Appointment Set Conn = New ADODB.Connection Conn.Provider = "exoledb.datasource" Conn.Open "http://ExchangeServer/Exchange/user/Calendar", "", "", 0 objAppt.DataSource.Open "http://ExchangeServer/Exchange/user/Calendar/item.eml", Conn, ADODB.ConnectModeEnum.adModeReadWrite, ADODB.RecordCreateOptionsEnum.adFailIfNotExists, ADODB.RecordOpenOptionsEnum.adOpenSource, "", "" ' Do other logic here... 'Clean up Conn.Close Set objAppt = Nothing Set Conn = NothingNext
Dim Conn As ADODB.ConnectionDim objAppt As CDO.AppointmentDim i As Long For i = 1 To 50000 Set objAppt = New CDO.Appointment Set Conn = New ADODB.Connection Conn.Provider = "exoledb.datasource" Conn.Open "http://ExchangeServer/Exchange/user/Calendar", "", "", 0 objAppt.DataSource.Open "http://ExchangeServer/Exchange/user/Calendar/item.eml", Conn, ADODB.ConnectModeEnum.adModeReadWrite, ADODB.RecordCreateOptionsEnum.adFailIfNotExists, ADODB.RecordOpenOptionsEnum.adOpenSource, "", "" ' Do other logic here...
'Clean up Conn.Close Set objAppt = Nothing Set Conn = NothingNext
After some amount of time of researching this with various tools including UMDH, it turned out that this problem was an issue with the ADO components that CDOEX and ExOLEDB uses to access the Exchange store. And to resolve this issue all you just need to do is make sure that you are running at least this version of msado15.dll (2.82.3959.0), which luckily is now available publicly in Windows 2003 SP2.
So if you are seeing anything like this I suggest that you go ahead and give Windows 2003 SP2 a try.