TPECI

Hello,
In The program I have 120 Pic , 2 MB in size, I've made a managed resource file(.resx) and add pics in that (as embedded resources) when i want use them, I define a IdictionaryEnumerator in order to enumerate pics. when I use GetEnumerator() method it add 30 MB to my Memory used by the program.
Please tell whats It's resoan and what should i do to get rid of such a problem
And is there another way taking less memory to enumerate resources
Thank You.



Re: Visual C++ General My Program Takes a lot of Memory

Bruno van Dooren

Yeah but what does your program do

If my program does char* mem = new char[300000000];

It will also use 300 MB of memory.

Try to find out what is in that 300MB, and who allocates it.





Re: Visual C++ General My Program Takes a lot of Memory

TPECI

I traced my program and I could find where is the problem:
ResxResourceReader ^ resx = gcnew ResxResourceReader("Buckets.resx");
IDictionaryEnumerator^ id = resx->GetEnumerator();

The line in red, where ever in my code i've used this line it's added MBs to the memory used by my program.





Re: Visual C++ General My Program Takes a lot of Memory

TPECI

Hello,
In The program I have 120 Pic , 2 MB in size, I've made a managed resource file(.resx) and add pics in that (as embedded resources) when i want use them, I define a IdictionaryEnumerator in order to enumerate pics. when I use GetEnumerator() method it add 30 MB to my Memory used by the program.
Please tell whats It's resoan and what should i do to get rid of such a problem
And is there another way taking less memory to enumerate resources
Thank You.