Memory

Started by
9 comments, last by Black Ace 18 years, 4 months ago
every time i load a model from a file it takes huge amounts of memory from the app like 6mb memory to load a single model pls tell me if this is natural or is there is something wrong with my code.
What is the difference between Jurassic Park and Microsoft? One is an over-rated high tech theme park based on prehistoric information and populated mostly by dinosaurs, the other is a Steven Spielberg movie.
Advertisement
Well that kinda depends, what model format are you using? How many vertices are there, etc.

But you're probably doing just fine.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
its a .x file here is a link http:www.almarwa.org\SnowMan.rar try loading the model your self and tell me what happend
What is the difference between Jurassic Park and Microsoft? One is an over-rated high tech theme park based on prehistoric information and populated mostly by dinosaurs, the other is a Steven Spielberg movie.
Uh, I don't particulary have any of my own code that's able to view .x files although meshview seems to eat up about 600k when loading it so yeah 6mb seems a bit heavy then.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
the mesh viewer that came with directX takes about 7mb opening so i think its my machine ;) thats better than the code being the problem.
What is the difference between Jurassic Park and Microsoft? One is an over-rated high tech theme park based on prehistoric information and populated mostly by dinosaurs, the other is a Steven Spielberg movie.
Quote:Original post by Black Ace
the mesh viewer that came with directX takes about 7mb opening so i think its my machine ;) thats better than the code being the problem.


Yeah, meshview without opening anything takes about 6mb. or 6.7 when opening that file.

HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
no i was talking about the change in memory i opend it manualy it was 7 when i opened it then changed to 14 when i loaded the mesh 14-7 = 7MB and i tried using
LoadTextureEX it minmized the memory usage to about 5mb can u tell me whats the Major diffrence between the two
What is the difference between Jurassic Park and Microsoft? One is an over-rated high tech theme park based on prehistoric information and populated mostly by dinosaurs, the other is a Steven Spielberg movie.
Unless you have written your own code to parse the .x file and build up the in memory representation, and its really inefficient, its probably not actually taking that much memory to load that specific file. I would theorize that the memory use you are seeing it probably from the system loading dlls for you. Try loading two models and see if the second one uses up another 7mb. If its a lot more reasonable (a few hundred kb maybe) then its just system overhead and nothing to worry about.

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
yeah i tried loading the same model twice it took double the memory jumped from 14 to 21 MB i kinda know whats the problem CreateTextureFromFile Takes way too much memory cause all the parmatrs are set to defualt on the other hand you have CreateTextureFromFileEx which you can specify all the parametrs so i cut down the usage to 1.5MB instead of 7MB if you have any ideas to improve this tell me
What is the difference between Jurassic Park and Microsoft? One is an over-rated high tech theme park based on prehistoric information and populated mostly by dinosaurs, the other is a Steven Spielberg movie.
Do note that the D3DX system itself (as well as other libraries) consume it's own piece of memory when it's loaded in your application's memory space.

That said, it is advisable to check for memory leaks if several megabytes just disappear over time without a just cause.

Niko Suni

This topic is closed to new replies.

Advertisement