ReleaseVersion problem.. because CString ....

N

nobrain

Release Version Only Problem..

this simple.. class include member variable CString,
make many object and free. but programe using memory
size is big and big..(only release version, debug version
is correct)

========exam code==============
#include <afxtempl.h>
class CObj:public CObject
{
public:
__int64 a,b,c,d,e,f,g,h;
CString sa,sb,sc,sd,se;
};
void TestFunc()
{
CTypedPtrArray<CPtrArray,CObj*> m_array;
CObj *p;
for (int i=0;i<120000;i++)
{
p=new CObj;
p->sa="123";
m_array.Add(p);
}
for (i=0;i<m_array.GetSize();i++)
delete m_array[m_array.GetSize()-i-1];
m_array.SetSize(0);
}
 
E

Eric Christoffersen [VCPP MSFT]

I put a call to TestFunc into a loop, and do not see the process memory (viewed in task manager) grow between iterations. The
memory looks to be correctly allocated and freed. On each iteration the memory grows from ~7megs to ~33megs, then falls
back to ~7megs. The behavior was the same for debug or release, and using VS .Net2002 and VS .Net2003.

When you call TestFunc in a loop do you see the process allocation grow between iterations? What version of Visual Studio
are you using?

Eric Christoffersen
Visual C++ Team
 
N

nobrain

-----Original Message-----
I put a call to TestFunc into a loop, and do not see the
process memory (viewed in task manager) grow between
iterations. The
memory looks to be correctly allocated and freed. On each
iteration the memory grows from ~7megs to ~33megs, then
falls
back to ~7megs. The behavior was the same for debug or
release, and using VS .Net2002 and VS .Net2003.
When you call TestFunc in a loop do you see the process
allocation grow between iterations? What version of Visual
Studio
are you using?

Eric Christoffersen
Visual C++ Team


.


i am using VC 5.0 /VC 6.0.
both same release version is grow memory.
 

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