• Advertisement
Sign in to follow this  

CreateTextureFromFileExA E_OUTOFMEMORY

Recommended Posts

I've been adding the new girl models made with the Bastioni Labs Blender plugin to Caveman 3.0. the skin textures generated are 2048x2048.  
 
I started getting some odd behavior loading skinned meshes - CTD with no error messages.   I changed the loading order so it loads static meshes, then skinned meshes, then textures. it gets almost all the way through loading textures , and then i get an E_OUTOFMEMORY.  
 
they are being loaded into memeory pool D3DPOOL_MANAGED, so one copy goes in ram, and one in vidram (if possible).
 
now here's the thing: this is on the new development rig. i7-6700K gtx1080. 16 gig ram, 4 gig vidram. and is says i'm running out of regular ram, not vidram.  
 
i wrote a couple quick and dirty routines to check free ram.
 
the first repeatedly mallocs and frees a buffer in i meg incrents in size intil it fals, and then returns the size of the last sucessful allocation - ie Largest contiguous block. this starts at say 750 meg or so after data segment is allocated (almost all game data structures are static AOSs) - and goes right down to zero as loading proceeds.  
 
the second routine tries to allocate 10,000 1 meg buffers at once and returns how many it could. it always says it could allocate all 10 gig.
 
for the moment i turned off a huge unused astar map, and reduced the terrain chunk cache size from 30 to 20. the new instanced plants add 5 buffers totaling 50,000 instances of data to EACH terrain chunk.
 
but whats up with this ram thing?
 
am i hitting some kind of data segment limitation? do i get 16 gig, but it has to be on the heap, and in i gig or smaller chunks?
 
 

Share this post


Link to post
Share on other sites
Advertisement
Is your app 32bit? If so, the OS has 4GB of address space to cover all of RAM and all the other hardware that exists in address space - so 2GB or 16gb of physical RAM will get you about as far.

Share this post


Link to post
Share on other sites

Is your app 32bit?

time to recompile as 64 bit!

so much for supporting 32 bit PCs...

or should i try to keep it to 4 gig ram required? 

i'm not paging anything yet really...

and i could put the textures on a diet

Share this post


Link to post
Share on other sites

How many 2048x2048 textures have you?  Are they DXT-compressed or RGBA/RGBX?  Have you calculated how much memory is required for a full mipmap pyramid of a texture this size?  It may indeed be time to put them on a diet.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement