Outlook Memory Question

S

sonomaenterprises

Background:

I have an Outlook Add-in that creates a task and/or Appointment item,
linking (item.links) it to a number of contacts. If the user requests to
link it to more than 100 people I create multiple items with no more than 100
links.
I create these items in a sub that creates a new item and find the contact
and links them to the item, one by one.

Problem:

After I create the first item, by calling a sub, I retrun and am ready to
call the sub again to create the 2nd item; however the memory that was
claimed creating the 1st item is not released. I have checked to make sure
that all objects are set to nothing, I have even checked the locals when I
return and all the objects are 'nothing'. If I exit the loop creating the
items the memory is released. If I attempt to create the 2nd item it errors
out on the item save.

Program Flow:

Sub Create_Items

for i=1 to NumOfItems 'the upper bound is basically fix(NumOfContacts/100)
'Mem usage is ~40mb
Call Proc to create item
'Mem is now ~90MB
'if I exit the for now and exit the Create_items sub the memory goes back to
~40MB
next
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top