Texture Memory Leak

I am trying to run SoaSE on Wine.  I am having a problem in which the SoaSE gets an out-of-memory error (GL_OUT_OF_MEMORY) from the Direct3D subsystem.  I know Wine and Linux are not officially supported platforms for SoaSE, but I have reason to believe this problem exists on Windows as well.

There is a pretty good description of the problem at this link:

http://bugs.winehq.org/show_bug.cgi?id=16456#c4

The gist is that there is a texture memory leak in SoaSE.  On Wine, the leaked memory is allocated on the graphics card, so SoaSE runs out of texture memory within minutes.  On Windows, apparently the leaked memory is allocated in system RAM and is therefore much more manageable.  Also, the Wine version would last somewhat longer if the texture detail was reduced in SoaSE.

I can't personally vouch for this diagnosis, but it seems sound.  I can say with certainty that the latest version (the update in December '08) still has this problem.

There is a patch for Wine that forces the SoaSE leak into system RAM like on Windows, so I will try that.

I am posting this here to help others who have the same problem.  Also, I hope this will bring the memory leak to the attention of the developers so they can fix the problem.

Thanks Ironclad for a great game!

2,156 views 3 replies
Reply #1 Top

We are unable to see any evidence of texture leakage. Is there some way to recreate it without using Wine?

Reply #2 Top

Well, if the explanation at the winehq link is correct, it should look like any other memory leak on Windows.  I never noticed a problem with SoaSE on my Windows Vista64 machine (other than a slowdown with battles between hundreds of ships).  That machine has 4GB system RAM and 512MB video RAM.  My Linux/Wine machine has 6GB system RAM and 1GB video RAM.

Outside of Wine, I don't have much visibility into what is going on.  I suppose in Windows, all I have is Task Manager.  I would max out the texture detail settings and play a long game with lots of geometry.  I haven't tried this yet.

I am a developer myself, though I'm not very familiar with Direct3D.  And of course there isn't much I can do without the source.  I can get Wine to log the relevant API calls.

When I get the GL_OUT_OF_MEMORY error, it is always in a call to IDirect3DSurface::LockRect().  If there is a leak, it is probably involving IDirect3DSurface::LockRect()/IDirect3DSurface::UnlockRect().

I wish I had some better data for you.  I wouldn't like it much either if a user told me I had a memory leak, but couldn't recreate it.  If the commenter on winehq turns out to be wrong and this is just a Wine issue, I apologize for wasting your time.

I'll continue to investigate this.  If I find anything else, I'll post it here.

Reply #3 Top

Well, I tried a small game on the Windows machine.  I had all of the effects settings maxed.  I played the game through to the end, and I took my time.  The game ran several hours and didn't climb much over the 1.3GB it used at the beginning.  So much for the Windows memory leak theory!

Sorry for jumping to conclusions.  I'll let the Wine folks know my results.