Re: Debug vs Release mode - memory leak by John
John
Tue Jul 22 00:45:48 CDT 2008
Hi Alf P. Steinbach,
Thank you for your prompt reply.
I have checked with some memory leak tools. But they could not identify
the leaks which are due to CStringArray objects.
I debugged line by line and paralelly checking in "VM Size" in task manager.
After calling .RemoveAll(), it dint decrease the memory. When adding strings
to this array, it is increasing the memory but not decreasing with
RemoveAll(). If I allocate on heap, it is deallocating the resources. But, I
cannot replace all CStringArray objects with TCHAR** object. This
application s there in production. How to achieve this?
I tried to simulate this in sample application. It is working fine. Any
limitations are there with CStringArray?
In this application, lot of CStringArray and CMap objects are there. Can
MFC manage if plenty of CStringArray and CMap objects in the application?
Please guide me.
Thanks and Regards,
John.
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:8aOdncuerrUD8hjVnZ2dnUVZ_t3inZ2d@posted.comnet...
>* John:
>>
>> I am able to release the resources (CStringArray objects) in debug
>> mode. But, not in Release mode.
>>
>> Any project settings or compiler options are required?
>
> Hi.
>
> Try to create a *minimal* program that exhibits the problem. If that
> doesn't help you, try posting that example here.
>
> How are you checking whether your resources are released?
>
> Are there any suspicious ASSERTs or the likes? Note that such code is
> removed in a release build.
>
> Cheers, & hth.,
>
> - Alf
>
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is it such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?