Re: Problems programmatically creating items in PSTs with Outlook
- From: "Stephen Griffin [MSFT]" <sgriffin@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Jan 2006 10:03:07 -0500
>What if I wanted to create a large number of PSTs in one session?
Well - it looks like an older build of the filter has a leak and the newer
build does not. So whatever the leak was, we've fixed it. So I really don't
see what you're worried about. Just install the new filter and you won't
have a problem.
"Chris" <chrisf@xxxxxxxxxxxxxxxx> wrote in message
news:6BAAC8C4-03FC-4DE4-B916-1E2B1E99D935@xxxxxxxxxxxxxxxx
> Hi Dmitry,
>
> Thanks for your response.
>
> I understand what you mean about the PST provider intializing and keeping
> hold of memory, but its the difference of behaviour depending on which
> Outlook 2003 update installed that troubles me. What if I wanted to create
> a
> large number of PSTs in one session?
>
> Regards,
> Chris
>
> "Dmitry Streblechenko" wrote:
>
>> Why do you think there is a memory leak? I am guessing that as soon as
>> you
>> create the first message in a PST store, PST provider initializes
>> something
>> and keeps it in memory.
>> As long as the memory usage does not go up with each new message created
>> in
>> the same PST, I personally wouldn't worry about it.
>> Also note that MAPI has its own memory allocator, so when a MAPI memory
>> block is released using MAPIFreeBuffer, it is not necessarily released
>> back
>> to Windows; at least not immediately.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Chris" <chrisf@xxxxxxxxxxxxxxxx> wrote in message
>> news:E36B7E6B-1D71-46DA-B355-7EA0BEC09EE1@xxxxxxxxxxxxxxxx
>> > (Re-posted from office.developer.com.add_ins)
>> >
>> > I have a test application that simply creates a PST file, creates a an
>> > empty
>> > message within it and saves the item. This process of creating another
>> > PST
>> > file and message within it is repeated ten times.
>> >
>> > The code flow is:
>> >
>> > for (int n = 1; n < 11 ; n++)
>> > {
>> > CComPtr<IMAPIFolder> pDestRootFolder;
>> > CComPtr<IMessage> pDestinationMessage;
>> >
>> > {Create a PST file of filename c:\test_n.pst}
>> >
>> > pDestRootFolder = {the root folder of the generated PST}
>> >
>> > pDestRootFolder->CreateMessage(NULL, 0, &pDestinationMessage);
>> > pDestinationMessage->SaveChanges(FORCE_SAVE);
>> >
>> > {Write out the value of 'n' and process' memory usage}
>> >
>> > }
>> >
>> >
>> > When this program is run on a system with Outlook 2003 base or SP1
>> > installed, it behaves correctly. However, after I upgraded Outlook 2003
>> > to
>> > SP2, a memory leak of approximately 3-4MB is observed after the first
>> > message
>> > was written to each new PST file:
>> >
>> > PST file written Memory used (KB)
>> > 1 13,144
>> > 2 16,680
>> > 3 20,168
>> > 4 23,660
>> > 5 27,144
>> > 6 30,632
>> > 7 34,124
>> > 8 37,676
>> > 9 41,160
>> > 10 44,716
>> >
>> > After some more investigation, I could reproduce this memory leak on 4
>> > out
>> > of 5 PCs with Outlook 2003 SP2 installed. Comparing the Outlook dlls
>> > that
>> > were installed on these PCs, the only noticeable difference was the
>> > version
>> > of Outlfltr.dll installed. On the PCs where the memory leak was
>> > observed,
>> > V1.2.32.1 of Outlfltr.dll was installed. On the PC where there was no
>> > memory
>> > leak V1.4.2607.0 was installed.
>> >
>> > On one of the PCs with Outlfltr.dll V1.2.32.1 installed, I performed an
>> > Office update and installed the latest Junk Email Filter update for
>> > Outlook
>> > 2003 SP2. This installed Outlfltr.dll V1.4.2607.0 and the memory leak
>> > disappeared.
>> >
>> > Could anybody explain why the Outlook Junk Email Filter dll would cause
>> > a
>> > memory leak with programmatically creating messages in a PST?
>> >
>> > Thanks in advance,
>> > Chris
>> >
>>
>>
>>
.
- References:
- Re: Problems programmatically creating items in PSTs with Outlook 2003
- From: Dmitry Streblechenko
- Re: Problems programmatically creating items in PSTs with Outlook
- From: Chris
- Re: Problems programmatically creating items in PSTs with Outlook 2003
- Prev by Date: Re: Voting buttons
- Next by Date: Re: Stack around variable rgval ist corrupted
- Previous by thread: Re: Problems programmatically creating items in PSTs with Outlook
- Next by thread: Programmatically creating Distribution Lists
- Index(es):