the usage in short:
------------
CBitmap bm;
CClientDC dc(NULL);
bm.CreateCompatibleBitmap(&dc,4096,4096);
-----------
If I understand it right, it needs 4096*4096*3= approx. 50MB of video memory.
Is this correct?
For my current project it is used once in the app. I has to restart the app many times. No problem half of the day.
But then I get the error 8: "insufficient memory". It can only resolved if I restart the PC.
Is the problem in my app?
Does win XP grabs memory and do not release it?
Is it really the video memory?
Can I check the free video memory?
Is the problem in my app?
Does win XP grabs memory and do not release it?
Is it really the video memory?
Can I check the free video memory?
Do any of your other applications show a problem? I bet they don't, so the problem is with your application.
Also, posting those 3 lines of code tells us absolutely nothing except the parameters you're using to call the function. How would those 3 lines look if your application was working correctly? There would be no difference.
Unless we have your entire application, run it, and see the behaviour, then no one will be able to tell you exactly what you're doing wrong. More then likely you are allocating resources and never releasing them.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; June 13th, 2012 at 03:44 AM.
Possibly your program leaks resources. Check this with Task Manager. See whether Handle Count, GDI Objects and Memory Usage are constantly growing when the program is running. To see all these counters, use View - Select Columns dialog in the Task Manager.
Possibly your program leaks resources. Check this with Task Manager. See whether Handle Count, GDI Objects and Memory Usage are constantly growing when the program is running. To see all these counters, use View - Select Columns dialog in the Task Manager.
Hello Alex,
you mean, that these resources will not be released automtically when the app is terminated???
What could it be that interfered with resources used by CreateCompatibleBitmap?
Of course, all resources are released when application is terminated. But if your application allocates some resources (like GDI objects) all the time without releasing them, finally some of these allocations fails. This is called resource leak. So, learn your application behavior with Task Manager.
For example, you see that your application consumes 50 GDI objects. 1 hour later - 70 objects, several hours later - 200 objects etc. This is resource leak.
The same applies to the memory, handles, threads etc. - actually, all types of resources.
ok, I will check it.
But the Task Manager View-menu has only these items:
(translated from German)
- Update
- Speed for Update
- CPU-history
- Show kernal-times
ok, I will check it.
But the Task Manager View-menu has only these items:
(translated from German)
- Update
- Speed for Update
- CPU-history
- Show kernal-times
?????
thx.
Ralf
My version of XP Task Manager certainly does have the "Select Columns..." option in the View Menu. If you don't believe me, do a google search and you will find that it does exist.
Bookmarks