   Why does CreateDevice consume 9 MB of memory ?
  I`ve been tracing memory leaks and all excessive memory allocations in my engine last week and managed to get Memory consumption down from 60 MB to 35 MB. However, when I traced d3dapp.cppI realized, that when it calls m_pD3D->CreateDevice()    , it takes up 9 MB of memory (RAM) - not Graphics`s Card memory - but CPU`s RAM. That seems way too much to me. I`m using FreeMemutility to find out the current amount of free RAM.Is it normal ?[edited by - VladR on February 2, 2004 5:00:58 PM]
  Do you create the device with the managed flag? ;  What flags are on your mind ?IDirect3D8::CreateDevice   takes only these DWORD   BehaviorFlags:D3DCREATE_FPU_PRESERVED3DCREATE_HARDWARE_VERTEXPROCESSING D3DCREATE_MIXED_VERTEXPROCESSING D3DCREATE_MULTITHREADED D3DCREATE_PUREDEVICE D3DCREATE_SOFTWARE_VERTEXPROCESSING D3DCREATE_DISABLE_DRIVER_MANAGEMENT  ;  Also, are you using the Debug or Release runtime libraries? ;  I`m using Debug libraries, but it`s doing the same with Runtime ones.    VladR Avenger 3D game;  Personally that seems reasonable to me... all the things that DX does for you (think managed pools etc.) certainly warrant a bit of overhead, and 9MB is nothing in modern apps. ;quote:Original post by AndyTX  Personally that seems reasonable to me... all the things that DX does for you (think managed pools etc.) certainly warrant a bit of overhead, and 9MB is nothing in modern apps.   Well, 9 MB is pretty much if you`d like to run the game on a machine with only 32 MB of memory. I`m targeting the shareware market which is known for its old HW. While the game runs acceptably on 64 MB of RAM, I`m sure that if I managed to do something with those 9 MB, it could run well on 32 MB too.I just don`t want to set a minimum configuration at 64 MB of RAM.I have personally 1024 MB of RAM, but I know QUITE A LOT   of people who still have just 32 or 64 MB at best. For example, my thirs test machine at home still has 64 MB of RAM and I plan on leaving it at that and I`m sure there are lots of people like me that don`t upgrade 5yrs old PCs - but just leave it like it is.Unfortunately, I can`t think of thing I could do with the way how CreateDevice allocates memory.  VladR Avenger 3D game;  Keep in mind it does load all the DX DLL's. Ppen the Output window and watch all the dll's being loaded. That's where all your memory goes.  D3D9 is 2 megs by itself!!CheersChris   [edited by - chollida1 on February 3, 2004 2:39:52 PM];  If you''re targeting nasty old machines like that you shouldn''t be using DirectX 8 or 9... try using DX3 and you will have better results. ;quote:Original post by Anonymous Poster  If you''re targeting nasty old machines like that you shouldn''t be using DirectX 8 or 9... try using DX3 and you will have better results.   Nasty Machines ? Those Machines used to run Hiden&Dangerous 1 quite well. I played Hidden1 on Celeron 400 from start to end on TNT1 so it definitely isn`t crappy machine. Also Quake3 was playable on Celeron 400 with TNT1 (albeit around 25 fps).As for DX3, you mean like rewriting all render code from scratch just for DirectX 3? Who in his rightest mind could have DX3 installed ? Usually, 400 MHz machines used to have DirectX 7, so I could understand your objection that my game isn`t written in DirectX7, but DX3 ? Jesus Christ when has it been ? Around the time when there were 66 MHz machines ?  VladR Avenger 3D game