PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins oom doesnt free memory while looping through items collection.

Reply

oom doesnt free memory while looping through items collection.

 
Thread Tools Rate Thread
Old 15-07-2003, 10:57 AM   #1
John Smith
Guest
 
Posts: n/a
Default oom doesnt free memory while looping through items collection.


Hello,

oom 2002 doesnt free memory while i loop though items collection.


dim iItems as Outlook.Items
Dim iItems2 as outlook.Items
Dim iItem as Object
Dim newItem as Object

set iItems=......

for each iItem in iItems
set newItem = iItems2.Add("IPM.Appointmen.MyPM")
newItem.SomeProp = iItem.SomeProp
....
newItem.Save
set newItem=Nothing
next


While iterating throug iItems collection oom doesnt free memory and i end
up with windows running out of sysres.
Are there any warkarounds for this problem?

Thanks!


  Reply With Quote
Old 15-07-2003, 01:42 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: oom doesnt free memory while looping through items collection.

That is a known bug in Outlook memory management. Aside from
increasing the Windows virtual memory available on the computer you
can use CDO 1.21 code or Redemption code (www.dimastr.com/redemption)
to work with an object model that has fewer memory leaks.

If you are using the Outlook object model you can restrict the Items
collection to make it smaller and you can use SetColumns to set the
fields you will work with to reduce the memory footprint of the
collection. Both also will speed up your code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


"John Smith" <vitalij@alittera.com> wrote in message
news:enKgb$rSDHA.1912@tk2msftngp13.phx.gbl...
> Hello,
>
> oom 2002 doesnt free memory while i loop though items collection.
>
>
> dim iItems as Outlook.Items
> Dim iItems2 as outlook.Items
> Dim iItem as Object
> Dim newItem as Object
>
> set iItems=......
>
> for each iItem in iItems
> set newItem = iItems2.Add("IPM.Appointmen.MyPM")
> newItem.SomeProp = iItem.SomeProp
> ....
> newItem.Save
> set newItem=Nothing
> next
>
>
> While iterating throug iItems collection oom doesnt free memory and

i end
> up with windows running out of sysres.
> Are there any warkarounds for this problem?
>
> Thanks!
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off