Memory Management

Started by Evil-Devil, January 11, 2007, 00:00:41

Previous topic - Next topic

Evil-Devil

Well, I came up with the question how to handle all the data a game may need.

Assuming my game would take at least 100MB of Data to play a game level I have to load the data and send it to the specific hardware. In this case I reduce it to texture and model data.

So, when I load my data with NIO and send the texture data to the graphic card for creating a texture name every data that is larger than my graphic card ram will be stored by the operating system in the swap file/system ram, is this right? All created texture names will be stored in my application to refer to them and i can free up every NIO buffer after creating the texture, right?

For the model data I assume I have to store them the whole usage time within my application, as the vertex data won't be hold by the graphic card. I may store them as POJO or anything else that fit as long I have them in the VM memory.

And at last, when using large package with textures in, should I stream the data in or read the whole package at once? AFAIK the heapspace size should not be set to high. 16MB for a single texture would be more than enough, but when I load a large package that may not enough. The only way I assume is to stream the data in. The package header may be around 2MB, so there would still 14MB free for loading the textures one by another.

Please give me your comments :)

Evil

Evil-Devil


Matzon

Quote from: Evil-Devil on January 11, 2007, 00:00:41
So, when I load my data with NIO and send the texture data to the graphic card for creating a texture name every data that is larger than my graphic card ram will be stored by the operating system in the swap file/system ram, is this right? All created texture names will be stored in my application to refer to them and i can free up every NIO buffer after creating the texture, right?
yes

Quote from: Evil-Devil on January 11, 2007, 00:00:41
For the model data I assume I have to store them the whole usage time within my application, as the vertex data won't be hold by the graphic card. I may store them as POJO or anything else that fit as long I have them in the VM memory.
Yes, however consider making your format easier to stream from disk to hardware, instead of keeping it in memory (especially when you have a large level size).

Evil-Devil

Thank you Matzon!
Thats helps me alot to redo my engine design :)