memory leak problem #2

hello,
i'm facing a memory leak problem when my application runs for a long time. i 
tried to figure out the source and came to a very small demo app to reproduce 
the behaviour. i create a dialog based mfc app, added a member variable of 
type CArray< CString*, CString* > to store CStrings*. then i added two 
buttons 'add' and 'remove'. the 'add' button creates new strings and adds to 
the array.

void TestDlg::Add()
{
  for ( int i = 0; i < 100000; i ++ )
  {
    CString* pTemp = new CString;
    *pTemp = "long text....";       // about 100 characters

    m_Array.Add( pTemp );
  }
}

the 'remove' button removes the data from the array.

void TestDlg::Remove()
{
  for ( int i = 0; i < 100000; i ++ )
  {
    delete m_Array.GetAt( m_Array.GetSize() - 1 );
    m_Array.RemoveAt( m_Array.GetSize() - 1 );
  }
}

i thought that the memory should be back to the start value when the calls 
to add and remove are balanced. this works perfectly in the debug version. i 
use the task manager to watch the mem usage.
but it haves completly different in the release version. the memory seems 
not to be freed when pressing the remove button. the elements are removed 
from the array because the app crashes when i press remove more often than 
add. i have noticed following behaviour.

app start: 2,7 mb
pressing add multiple times: 90 mb
pressing remove the same times: 90 mb ( very small decrease in mem usage )
pressing add the same time as before: 90 mb
pressing remove the same times: 90 mb
pressing add twice as often: 170 mb
pressing release to balance add calls: 170 mb

the freed memory seems to be reused when allocating new strings. so maybe 
some kind of caching in release version? so i have my app, deleted all 
entries from the array, mem usage in task manager at 170 mb. if it is a cache 
it should be freed when memory is needed. so i launched a second instance, 
adding strings into the array until the physical mem is exhausted. then 
windows starts to move app memory to the page file, as is can see in the task 
manager. strange now, that all running processes are decreased in phys. 
memory and increased in virtual, but only my demo app with the freed strings 
stays in phys. memory.
then i changed the demo app to store char* in the array and created new 
char[ 100 ] data to store and delete. then it works in debug and in release. 
memory is freed as expected. then i change the array to CArray< CString, 
CString >, added CString directly ( no new ) and removed from array. again 
memory is not freed.

does any has any idea what can cause this behaviour with CString data ?
i have tried with win2k, winxp, server 2003, and i'm using vc++ 6.0 with sp6.

many thanks in advance
enrico

0
enricolyb (7)
3/4/2005 5:55:03 PM
vc.mfc 33608 articles. 0 followers. Follow

15 Replies
430 Views

Similar Articles

[PageSpeed] 46

I don't know about the memory leak.
But

> void TestDlg::Remove()
> {
>   for ( int i = 0; i < m_Array.GetCount(); i ++ )
>   {
>     delete m_Array.GetAt( i );
>   }
    m_Array.RemoveAll();
> }

You might want to try something, change your array from CString points to
just CString and see if there is a difference. You will be allocating just
as many CStrings, but you won't have to worry about the deallocating part.
Just to see if there is a difference.

CArray< CString>
> void TestDlg::Add()
> {
>   for ( int i = 0; i < 100000; i ++ )
>   {
>     m_Array.Add( "long text....");
>   }
> }

> void TestDlg::Remove()
> {
        m_Array.RemoveAll();
    }


AliR.

"enrico lyb" <enricolyb@discussions.microsoft.com> wrote in message
news:53E43C92-4211-4C4A-A75F-9439DB08627C@microsoft.com...
> hello,
> i'm facing a memory leak problem when my application runs for a long time.
i
> tried to figure out the source and came to a very small demo app to
reproduce
> the behaviour. i create a dialog based mfc app, added a member variable of
> type CArray< CString*, CString* > to store CStrings*. then i added two
> buttons 'add' and 'remove'. the 'add' button creates new strings and adds
to
> the array.
>
> void TestDlg::Add()
> {
>   for ( int i = 0; i < 100000; i ++ )
>   {
>     CString* pTemp = new CString;
>     *pTemp = "long text....";       // about 100 characters
>
>     m_Array.Add( pTemp );
>   }
> }
>
> the 'remove' button removes the data from the array.
>
> void TestDlg::Remove()
> {
>   for ( int i = 0; i < 100000; i ++ )
>   {
>     delete m_Array.GetAt( m_Array.GetSize() - 1 );
>     m_Array.RemoveAt( m_Array.GetSize() - 1 );
>   }
> }
>
> i thought that the memory should be back to the start value when the calls
> to add and remove are balanced. this works perfectly in the debug version.
i
> use the task manager to watch the mem usage.
> but it haves completly different in the release version. the memory seems
> not to be freed when pressing the remove button. the elements are removed
> from the array because the app crashes when i press remove more often than
> add. i have noticed following behaviour.
>
> app start: 2,7 mb
> pressing add multiple times: 90 mb
> pressing remove the same times: 90 mb ( very small decrease in mem usage )
> pressing add the same time as before: 90 mb
> pressing remove the same times: 90 mb
> pressing add twice as often: 170 mb
> pressing release to balance add calls: 170 mb
>
> the freed memory seems to be reused when allocating new strings. so maybe
> some kind of caching in release version? so i have my app, deleted all
> entries from the array, mem usage in task manager at 170 mb. if it is a
cache
> it should be freed when memory is needed. so i launched a second instance,
> adding strings into the array until the physical mem is exhausted. then
> windows starts to move app memory to the page file, as is can see in the
task
> manager. strange now, that all running processes are decreased in phys.
> memory and increased in virtual, but only my demo app with the freed
strings
> stays in phys. memory.
> then i changed the demo app to store char* in the array and created new
> char[ 100 ] data to store and delete. then it works in debug and in
release.
> memory is freed as expected. then i change the array to CArray< CString,
> CString >, added CString directly ( no new ) and removed from array. again
> memory is not freed.
>
> does any has any idea what can cause this behaviour with CString data ?
> i have tried with win2k, winxp, server 2003, and i'm using vc++ 6.0 with
sp6.
>
> many thanks in advance
> enrico
>


0
AliR1 (391)
3/4/2005 7:08:15 PM
I am not sure about the memory leak part either. I dont see it.

Instead of using CArray, what about CStringArray?

-------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6840)
3/4/2005 7:13:54 PM
yes, i have tried too. the same problem, in fact even worse as the memory is 
not reused again. i.e. adding strings leads to increase in memory, removing 
from array does not free, adding more strings and memory increases again.
0
enricolyb (7)
3/4/2005 7:19:04 PM
hello,
now i have tried with CStringArray, same effect.
then i changed to directly free the data after allocating. same effect.
i even tried to use a local variable whose destructor must be called, same 
effect.
so now i have an mfc dlg app, with one button executing one function:

void TestDlg::Method()
{
  CStringArray Array;
  for ( int i = 0; i < 1000000; i ++ )
  {
    Array.Add( "long text..........." );
  }
  Array.RemoveAll();
}

in debug version, perfectly ok.
in release version the mem usage in task manager growing, but not freed.

the help for the task manager says that the mem usage gives info about the 
working set. but as i understood, the working set should be freed as 
necessary.
0
enricolyb (7)
3/4/2005 7:43:05 PM
Does your program exit smoothly? IOW, do you see it in task manager
after you exit?

I will also try it by seeing the effect of reducing the number 1000000
to something much smaller, say 10000 and see if that matters.

-------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6840)
3/4/2005 7:50:26 PM
yes, program exits smoothly. task does not stay in task manager. and i see 
the memory graph dropping when exiting the program.

with a smaller number of strings in the array the effect is the same, but of 
course with smaller mem usage.
0
enricolyb (7)
3/4/2005 7:59:06 PM
Sounds like the system keeps the memory attached to the process for a while
in case it needs more memory.  You should use a better tool to check for
memroy leaks.

Example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_detecting_a_memory_leak.asp

AliR.

"enrico lyb" <enricolyb@discussions.microsoft.com> wrote in message
news:2CC5350E-567E-4B39-8B9E-FA74303D9D0E@microsoft.com...
> yes, program exits smoothly. task does not stay in task manager. and i see
> the memory graph dropping when exiting the program.
>
> with a smaller number of strings in the array the effect is the same, but
of
> course with smaller mem usage.


0
AliR1 (391)
3/4/2005 8:10:25 PM

enrico lyb wrote:
> hello,
> now i have tried with CStringArray, same effect.
> then i changed to directly free the data after allocating. same effect.
> i even tried to use a local variable whose destructor must be called, same 
> effect.
> so now i have an mfc dlg app, with one button executing one function:
> 
> void TestDlg::Method()
> {
>   CStringArray Array;
>   for ( int i = 0; i < 1000000; i ++ )
>   {
>     Array.Add( "long text..........." );
>   }
>   Array.RemoveAll();
> }
> 
> in debug version, perfectly ok.
> in release version the mem usage in task manager growing, but not freed.

You may have another problem and you are assuming it has something to do 
with the string container. Are you by chance changing brushes in a dc 
and not returning the original brush before destroying the dc? That 
would cause the mem usage to go up without being a memory leak.

I say this because I ran into just such a problem about a year or two 
ago. And it would show in 98 but not xp!

Best, Dan.

---
I've added a new code project article!
http://www.codeproject.com/useritems/EGA.asp

0
public21 (290)
3/4/2005 10:22:39 PM
It is hard to tell from the task manager what the real reason is. I'd suggest creating a
debuggable release version and do some single stepping to see if the storage is being
properly freed.
				joe

On Fri, 4 Mar 2005 11:43:05 -0800, "enrico lyb" <enricolyb@discussions.microsoft.com>
wrote:

>hello,
>now i have tried with CStringArray, same effect.
>then i changed to directly free the data after allocating. same effect.
>i even tried to use a local variable whose destructor must be called, same 
>effect.
>so now i have an mfc dlg app, with one button executing one function:
>
>void TestDlg::Method()
>{
>  CStringArray Array;
>  for ( int i = 0; i < 1000000; i ++ )
>  {
>    Array.Add( "long text..........." );
>  }
>  Array.RemoveAll();
>}
>
>in debug version, perfectly ok.
>in release version the mem usage in task manager growing, but not freed.
>
>the help for the task manager says that the mem usage gives info about the 
>working set. but as i understood, the working set should be freed as 
>necessary.

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15977)
3/5/2005 3:54:34 AM
The heap is not implicitly freed. Example: Assume that * is free space and A is allocated
space. You could have a heap that looks like

AAAA*****************************************A************************************************A**************************A

and it will therefore always be the maximum size shown above, end-to-end. In fact, if it
turns into
A****************************************************************************************************************************A
your memory usage remains constant. You will not see memory usage decrease because task
manager reports the amount of address space in use, not the amount of use of the address
space (a critical distinction!). So in the second example, it may be that you have 32
bytes of memory allocated, but the space credited to task manager is 1MB. This is one of
the many reasons the task manager numbers are nearly useless for telling you what is
really going on.

Memory fragmentation results from having patterns like

AAAA*AA*AAA*A*AA*AAA**AAA*A*A**AA*AAAAA*AA*A*A*A*A*A*A*A*AAAAA*A**AAA*AA*AA*

where those little * blocks are too small to be useful. Therefore, subsequent allocations
have to extend memory, because nothing in memory is usable. Then the new memory fragments,
and the process repeats. This is particularly nasty in system services and other
long-lived applications, which is one reason I advise against MFC for system
services...you can't control the allocation (it turns out in VS7 you can, and I'm
investigating that as part of my discussion of program reliability in my new course, but
I've only been working on it for a couple weeks, and I've got many more weeks of research
to do).

As part of a course I'm developing, I'm working on some memory leak detection code, but I
just started this today and it isn't anywhere near functioning. And I'm going out of town
for a week. 

What I suggest is single stepping for a while. You can learn a lot by this process. Make
sure you have installed the C runtime (CRT) source files.
					joe


On Fri, 04 Mar 2005 20:10:25 GMT, "AliR" <AliR@newsgroup.nospam> wrote:

>Sounds like the system keeps the memory attached to the process for a while
>in case it needs more memory.  You should use a better tool to check for
>memroy leaks.
>
>Example:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_detecting_a_memory_leak.asp
>
>AliR.
>
>"enrico lyb" <enricolyb@discussions.microsoft.com> wrote in message
>news:2CC5350E-567E-4B39-8B9E-FA74303D9D0E@microsoft.com...
>> yes, program exits smoothly. task does not stay in task manager. and i see
>> the memory graph dropping when exiting the program.
>>
>> with a smaller number of strings in the array the effect is the same, but
>of
>> course with smaller mem usage.
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15977)
3/5/2005 4:03:29 AM
hello,

well, i don't think so. i make a new mfc dlg app, added one button, and this 
is the function for the button. of course, not a very useful app, but i used 
to reproduce the behaviour and to be sure that there is no other error like 
gdi or handle leak.
0
enricolyb (7)
3/5/2005 4:29:08 PM
hello,

well, interesting point. is there any way to automatically rearrange the * 
and get all A's togehter? in the docu i found HeapCompact, but this has no 
visible effect.
why is there a different effect if i store new char[ 30 ] data instead of 
CString? new char is also allocated on the heap, isn't it ? it should lead to 
the same fragmentation.

i found an article that says, one way to check for memory leak would be to 
monitor the private bytes in perfmon, but these are also not freed. they show 
the same value as the task manager.

you say, avoid mfc for service and long-running application, but what has 
this to do with mfc? i stepped into the CString, but this also only using new 
byte to alloc memory. i do not understand why the new called from mfc should 
behave differently as the new called directly. both is resolved to the 
malloc, isn't it ?

enrico

0
enricolyb (7)
3/5/2005 4:29:09 PM
and i also tried to use the LFH ( low-fragmentation heap ) of xp and server 
2003, but same effect.

0
enricolyb (7)
3/5/2005 4:29:09 PM
No. This is called "heap compaction" and it is not supported in native VC++ code. It *is*
supported in managed code. The HeapCompact call is left over from Win16, where it
sometimes would have an effect, but it is retained only for backward compatibility.

There should be no distinction in the char[30] vs. CString allocation.

The reason for avoiding MFC for long-running applications is that you have, at least in
VS6, no control over memory allocation; consequently, you end up with fragmentation
problems. And the same is true of C++. The issue is that in pure C++ you have the
capability of overriding the allocators and doing your own anti-fragmentation allocation
strategy. Prior to VS7, this capability did not exist for MFC, so it would defeat your
ability to implement a low-fragmentation storage allocator.

I should point out that I have designed and implemented high-performance low-fragmentation
allocators; we had one design that was so good that a huge number of allocations could
have been done as inline code without even calling the allocator itself. I probably spent
a month just tuning its performance (I even wrote a book that has a whole chapter devoted
to how to do storage allocation, but it is now long out of print).
					joe

On Sat, 5 Mar 2005 08:29:09 -0800, "enrico lyb" <enricolyb@discussions.microsoft.com>
wrote:

>hello,
>
>well, interesting point. is there any way to automatically rearrange the * 
>and get all A's togehter? in the docu i found HeapCompact, but this has no 
>visible effect.
>why is there a different effect if i store new char[ 30 ] data instead of 
>CString? new char is also allocated on the heap, isn't it ? it should lead to 
>the same fragmentation.
>
>i found an article that says, one way to check for memory leak would be to 
>monitor the private bytes in perfmon, but these are also not freed. they show 
>the same value as the task manager.
>
>you say, avoid mfc for service and long-running application, but what has 
>this to do with mfc? i stepped into the CString, but this also only using new 
>byte to alloc memory. i do not understand why the new called from mfc should 
>behave differently as the new called directly. both is resolved to the 
>malloc, isn't it ?
>
>enrico

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15977)
3/5/2005 9:06:53 PM
In message <53E43C92-4211-4C4A-A75F-9439DB08627C@microsoft.com>, enrico
lyb <enricolyb@discussions.microsoft.com> writes
>i thought that the memory should be back to the start value when the calls
>to add and remove are balanced. this works perfectly in the debug version. i
>use the task manager to watch the mem usage.

NEVER, ever user Task Manager to do other than broad trend analysis. Do
not use it to attempt to detect memory leaks. You will fail.

Use a memory analysis tool to detect memory leaks. There are various
free tools and commercial tools.

>but it haves completly different in the release version.

It would do. The debug heap has lots of extra overhead and a different
memory layout (linked list). It is designed for debugging and detecting
errors. The release heap is stored in a bit vector and is designed for
speed and compactness. You should not expect the heap to behave the same
from a memory layout perspective. You should expect the heap to behave
the same from an API perspective.

>does any has any idea what can cause this behaviour with CString data ?

Nothing to do with CString data (or any other data). You have made
assumptions that are incorrect about how memory is released back to the
OS by the heap - these assumptions may appear valid/sensible from your
point of view, but they do not necessarily match reality.

If you wish to detect memory leaks, use a free or commercial tool. The
tool I use on a day to day basis is Memory Validator. There is a 30 day
trial.

        http://www.softwareverify.com

Stephen
-- 
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk
RSI Information:        http://www.objmedia.demon.co.uk/rsi.html
0
snail (185)
3/7/2005 11:28:26 AM
Reply:

Similar Artilces:

Problems
Hi, I am encountering problems in publishing my page to the web. I would like to know how to change filtered HTML files to ordinary HTML files. It's giving me hell. I've been trying for the past 1 week. ...

Batch Sattlement Problem #2
Today was my first day with Mercury Payment. and end of day When I try to sattle the batch and I am keep getting error CONNETION ERROR. I am trying to sattle same way I was doing with city bank. Is mercury setting different way ? Is any body here to help me to sattle the batch. I am getting connection error. Please Help This is a multi-part message in MIME format. ------=_NextPart_000_02D9_01C6F83C.869E10F0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Gas, Any firewalls running? If so, turn them off temporarily to see if it = the...

Rule problem?
Hi, When i create at client based rule based on "Suspected to be junk email or from Junk senders" and define what email to move to my Spam folder in the Junk senders list some other senders end up in my Spam folder. I only have one sender listed in the Junk Senders list .. What could be the problem? Running Outlook 2K. -- /Martin ...

Memory usage in XP (memory leak detection)
Hi How can I found out the memory usage on XP ? My XP box uses over a week all memory and then has no resources available. It has 4GB memory (3.5 GB free) I used typeperf with the following: \Memory\Available Bytes \Memory\Committed Bytes \Memory\Pool Paged Bytes \Memory\Pool Nonpaged Bytes \Memory\Cache Bytes \Memory\Cache Bytes Peak \Process(_total)\Virtual Bytes Peak \Process(_total)\Virtual Bytes \Process(_total)\Working Set Peak \Process(_total)\Working Set \Process(_total)\Page File Bytes Peak \Process(_total)\Page File Bytes \Process(_total)\Private Bytes \Proc...

IS this possible? #2
Hi there. I have the following in Excel: A B C D 1 hello 1 2 test 0 3 bye 1 4 hi 0 5 bybye 0 6 tjou 2 now on another place in this sheet i want to see all the words under each other where the B value is bigger the 0 so: E F G 1 hello 2 bye 3 tjou So i only want to show th'ose words that have a bigger value. and i don't want whitelines between the words like this ( =IF(B1>0,A1,"") ) E F G 1 hello 2 3 bye 4 5 6 tjou One non-array play .. Use an empty col to the right, say col H Put in...

Permissions #2
The client has a telemarketer working leads. When the telemarketer has secured a demo, he converts the lead. At that time, a workflow kicks in and assigns the newly created account, opportunity, and contact to a different owner. That part is working correctly. The problem is if the telemarketer goes to Account and changes the view to Active Accounts, or Open Opportunities, or Active Contacts, he can see the ones he created from the Convert Lead process (no other ones). The client does not want this to occur. The telemarketer should only see the records he is the owner of. Does a...

Outlook Installation #2
When trying to install outlook I get an error message telling me that I cannot install Outlook because I'm either using Windows in it's Safe Mode or my Windows Installer is not installed properly, Anyone had this problem or knows what it might mean?? Thanks Fiona ...

Problem with Code
When I go through step by step at the last }.. it will have an exception but I am not sure where I have gone wrong. Please HELP. thanks The exception is Unhandled exception at 0x7c901230 in Startup.exe: User breakpoint. And the function that I map through is the following: void CDialogDicom::DoPreviewImage(CDataVolume dv, int nSliceWidth, int nSliceHeight) { char * pSrc = dv.GetFilename(0); int nPixelSize = dv.GetPixelSize(); int nSliceSize = dv.GetSliceNum(); if(nPixelSize == 1 || nPixelSize == 2) { char *pImage = new char[nSliceSize]; if(nPixelSize == 1) memcpy(pImage, pSrc, nSlic...

Please help me solve my problem
Hi, I Have a cell say a1 that has a continuously changing number it in and I want to track the highest number that it prints, and the same for the lowest number in cell a2. I would like these results to show up in the cells below them Im very new to programming and your help would be much appreciated many thanks Sacha David On Mar 5, 1:01=A0pm, Sacha David <sach1...@googlemail.com> wrote: > Hi, =A0I Have a cell say a1 that has a continuously changing number it > in and I want to track the highest number that it prints, =A0and the > same for the lowest number i...

AnimateWindow function problem
hi I want to hide my application on certain conditions when the application is minimized. Till now i was using ShowWindow to achieve this and it worked fine. Now when I am using the AnimateWindow API the window gets hidden but the window's entry in the taskbar remains. I am posting the code that i have written. void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == SC_MINIMIZE) { if(bMinimizeToTray) { this->AnimateWindow(200,AW_HIDE |AW_SLIDE | AW_VER_POSITIVE); // this->ShowWindow(SW_HIDE); return; } } CFrameWnd::O...

Sendmail problems
Ron, I hope your out there. I am using your sendmail in a huge spreadsheet as an order form. All data from option sheets that are ordered come to one main sheet. I want the user to send the main sheet and the option sheets for the models they order. Everything has been find through testing until today. The main sheet when sent out by itself is ok. But when it is sent along with the option sheets the vaules from formulas only in the center of the main sheet are all REF#. Why is this happeining? Barb Hi Barb Must see the workbook to see your problem Send me the workbook private ...

IP protocol problem
Hello all. I Need to set the TTL and the TOS values of an IP Packet. Please help me. regards. Ariel. "Ariel" <anonymous@discussions.microsoft.com> wrote in message news:087901c3986a$9c8ae710$a401280a@phx.gbl... > Hello all. > > I Need to set the TTL and the TOS values of an IP Packet. setsockopt with a level of IPPROTO_IP and a value of IP_TTL. A Winsock provider isn't required to support it, use getsockopt to get the option's setting to see if it's supported and it may not work with all socket types for all I know (I've only used it with raw soc...

Data validation problem
Hail to you all.... First post here and hopefully the last... Second, sorry if i'm not on the right board... Third, sorry for my not perfect english.... Well enough "being sorry thing" here my problem... I'm currently validating a form in excell and some bug just got int the equation wich i cannot remove (solve).... I got a list of text value c4:c28 wich contain some number like "p-12" i got a cell g4 wich CANNOT take any of the value in c4:c28 here what i got thus far : =MAJUSCULE(G4)<>RECHERCHE(MAJUSCULE(G4);C4:C28;C4:C28) it in french so i will give y...

Custom Entity problem 02-13-06
I had made a new custom entity called "Solution" this entity is relationed with Leads,Account, and Contact. The proble appear t when I convert a Lead ,who has one object "Solution" associated, into Contact or Account them the "Solution" not appear in the Contact or Account. I make relations with the new entity and Account and Contact but it doesn=B4t work. How can I do it? Thanks You probably need to do this via a callout. There is no way to "map" related records like this. -- Matt Parks MVP - Microsoft CRM "crmnovel" <lmalzueta@tele...

Encoding problem
Hi all, I'm using the XmlDocument class to create an XML document. I found out that in .NET there are special classes that they do that job a lot faster, namelly XmlTextWritter. My problem is that using the XmlTextWritter the encoding gets messed up. How do I set the XmlTextWritter's ecncoding to be the same as the one that the XmlDocument is using? I've tried this but doesn't work. System.IO.MemoryStream s = new System.IO.MemoryStream(); XmlTextWriter LWriter = new XmlTextWriter(s, Encoding.Unicode); Thanks in advance, Greg Your problem is not specific enough to provi...

not enough memory on excel 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel <i>run excel 2008 on mac snow leopard 2 g memory i upgrade to 3 g and same</i>&#32; message not enough memory can some one help me only word working Run Remove Office then re-install Office On 30/03/10 7:08 AM, in article 59bb629f.-1@webcrossing.JaKIaxP2ac0, "Snow_leopard@officeformac.com" <Snow_leopard@officeformac.com> wrote: > Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel > run excel 2008 on mac snow leopard 2 g memory i upgrade t...

Contact Problem #3
Recently we installed a new "C" drive and moved data from the old one. However, in Outlook, I cannot use the "To" and/or "CC" buttons. A message comes up "The address list could not be displayed. The Contacts list associated....it may have been moved or deleted, or you do not have permissions. To remove..." I am running Office XP/Students & Teachers, all updates are in. We removed the old Address book (.wab) (492KB) from the "E" drive (leaving a copy there) and it now resides at C/(user)/AppData/MS as the third folder, named Larry...

Problem with extending list formats and formulas
Hey all- I'm having a problem with extending list formats and formulas using Excel 2000. I know there are limitations to what that feature can do, but I thought I'd check here, since I have a very simple example that isn't working. I create a sheet with two columns. In the column A, I just enter any arbitrary number in each of the first 10 cells. For column B, I want to calculate the difference between the last two values in column A. In other words, B2's formula is =A2-A1, and B3 = A3-A2, etc.. I copy this formula down the first 10 cells of column B (skipping the first r...

forwarding problem
Hi I have a exchange email address that receives mails from the general public, let say "public_2006@microsoft.com". 1-I want to keep this mailbox for people who already know it and, this is the problem, we do not want to create a new one but have an "alias" of the preexisting one like "public2006@microsoft.com" ( w/out the underscore). 2-We want any email sent to each one of these two addresses, ends up in the other. Question: How can we achieve this goal without creating a new mailbox? Thanks In Active Directory Users and comptuers, just add the n...

Is it a memory leak
AoA I have used standard template library in one of my applications. I belive that memory leaks are due to stl components, mainly string. i wrote a sample program in VC 6.0 that clearly shows memory leaks in stl wstring str = L""; for( int a = 0 ; a < 100000 ; a++ ) { str += L"int"; } str.str.erase( str.begin() , str.end() ); str = L"int"; i wrote this code against a button in dialog based application. Before clicking the button, the memory usage is 3MB and after this code it is 17MB although i believe it should have been bac...

Reports Error CRM 1.2
Hi, i am facing a problem with how the reports on MS CRM 1.2... the issue is that half the chart is displayed (it is not resizing to match the full screen display) Thanks in advance Is this a custom report or a canned one? Are you having this problem when viewing the report online, or when printing the report? -- Matt Wittemann http://icu-mscrm.blogspot.com "Emile Seferian" wrote: > Hi, > > i am facing a problem with how the reports on MS CRM 1.2... the issue is > that half the chart is displayed (it is not resizing to match the full > screen display) > ...

Outlook Upgrade Problem
I upgraded from Office 2000 to Office XP - everything work fines except my Outlook. When I try to load Outlook I get the following message : "Unable to open your default e-mail folders. The .DLL file for the information service could not be found. MAPI was unable to load the information service PSTPRX.DLL. Be sure the service is correctly installed and configured." I can open outlook if I choose "default" setting , but then I don't have e-mail capability. Any ideas on how to solve this ? Please post or e-mail me at hmoore4016@yahoo.com - since I can't get...

Avg Cost problem
We use avg costing. However, some of the parts we use to fix customers' equipment are salvaged from retired equipment, not purchased. We assume a cost of zero for these salvaged parts. GP thinks otherwise, with average costing. But we want to track the salvaged parts at zero cost. One idea is to create separate item numbers (add "-S" suffix) but that seems like a real kludge. Another is to track them from a special "salvage" location, which helps with inventory but doesn't address the avg cost problem. Does anyone have suggestions how to handle this sit...

Exchange memory utilization
Is there any documentation detailing the exchange 2003 memory utilization , especially in coordination with the max store size. thanks CR What do you want to know? Exchange will use all the memory it can in the box, up to 4GB, for caching, and this isn't a function of store size. It will release memory so that other processes can get what they need. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "MSNews" <Craig@nowhere.org> wrote in message news:etwPVF%23RHHA.4832@TK2MSFTNGP03.phx.gbl... > Is there any documentati...

CEdit::SetSel() problem
Using the CEdit control, I want to trim some bytes off of the 'top' of the CEdit buffer without the CEdit control scrolling up when the bytes are being removed. I use CEdit::SetSel() to select the bytes to remove, with the bNoScroll set to TRUE so that the view doesn't scroll up. The problem is that the CEdit control scrolls up even though the bNoScroll is set to TRUE. Any help here would be appreciated. Michael. "Michael Broda" <mtbroda@rogers.com> wrote in message news:hsFib.99383$ko%.20236@news04.bloor.is.net.cable.rogers.com... > Using the CEdit control, ...