https://bugs.winehq.org/show_bug.cgi?id=33362
--- Comment #28 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Someone from comment #27)
Unless there is an actual memory leak there is not much we can do. Lowering graphic / texture settings might help (as you noticed), manually lowering the amount of video memory reported to the game (e.g. via the VideoMemorySize registry setting) is another possible option.
To lower it ? Do you mean the memory usage of the graphic card is related to the memory usage of the RAM when using wine ?
Not directly and not quite, but something to that effect probably happens. For one, each D3D resource has an associated object which takes some space in system memory. It's not much memory per-object but still. Then it's conceivable that the driver allocates some system memory for each GL resource the game creates. I imagine there isn't a full system-memory copy of each GL texture but, again, there is some memory used for bookkeeping and whatever at each point in time. More importantly, the driver will probably map areas of the video memory into the addressing space of the process and that might very well scale with the amount of GL resources used. Those memory mappings don't use actual system memory but still take away from the usable "memory space" by the process. The details here depend on the specific driver of course. So, by giving the game more "room" for graphic resources, it will might end up using more addressing space and possibly running out of it.
BTW how are you checking for the memory usage by the game process? What's your GPU model and video memory size?
ps aux | grep exe (or grep wine), free -m...Geforce GT 630, 2 GB graphic memory
Are you checking the RSS column or the VSZ one? RSS is the amount of actual memory used but what we're interested into here is VSZ aka the virtual memory / addressing space usage. For a 32-bit process on 64-bit Linux 4GB is all you get. Less than that on a 32-bit OS.
Wine reserves a large portion of the addressing space for all the memory allocations made by the game and the DLLs. The rest is available for native libraries, including libGL. My impression is that, at least in your case, at some point the process addressing space fills up and libGL fails to allocate more memory. You could try to verify that with ps or top.
Lowering the texture level and game details level make the bug become rare
(It seems setting the VideoMemorySize to the actual value of my graphic card make things worse than not setting it at all, with all apps...But maybe it's only a subjective impression ?)
Again, it depends. We should default to 1GB for your GPU. If the increased memory usage resulting from reporting 2GB of VRAM to the game makes it run out of addressing space, then sure. On the other hand there might as well be other games that e.g. require 2GB of VRAM to enable some feature and don't suffer as badly from addressing space exhaustion.