[Wine] Memory problems/questions

Martin Gregorie martin at gregorie.org
Sat Jul 30 09:13:13 CDT 2011

On Sat, 2011-07-30 at 07:50 -0500, Kairhos wrote:
> I have noticed that many games (Farcry 2, Fallout 3, Fallout: New
> Vegas, Drakensang) crash with some form of out of memory messages. So
> obviously something is leaking memory (whether it is wine or the game
> or drivers, I cannot say).
Can you see anything useful by running 'top' in a console alongside the
game that crashes? 

However, this will be no use if the game runs full screen because you
won't be able to see the console window that contains it. If that's the
case, what about using sar/sadf or pidstat? Both are part of the sysstat
package. It is a standard Fedora package, so should be part of your
distro too. If not, you can get it from

The most relevant parts of sysstat are 'sar', which silently snapshots
and logs system stats which are analysed by 'sadf', and 'pidstat', which
can display snapshots of memory usage by process. 

pidstat would be my starting point for seeing where the memory went,
especially if the game runs full screen. For example:

	pidstat -r 2 10 >pidstat.log 

will make 10 snapshots of all active processes at 2 second intervals,
capturing the output in pidstat.log.


>  But it always happens as soon as wine uses ~1.5 GB of RAM. Also I
> wonder if it has something to do with this bug:
> http://bugs.winehq.org/show_bug.cgi?id=25428
> I ran the Memory allocation test program attached to that bug and it
> only gets up to 1476 MB with wine, whereas it can allocate the full
> 2GB when compiled with gcc and run natively. I also linked it with
> -Wl,--section-start,.interp=0x7bf00400 as suggested by Alexandre, but
> that didn't make a difference. So my questions are as follows:
> - Can anyone (with a PAE kernel) confirm the bug report
> - Does anyone have a patch for current wine that implements the option
> of setting user space and kernel space memory limits. Or can anyone
> tell me where to find these limits in the source code. I'd like to
> play around a bit with these limits to force other distributions (eg.
> 3/1 GB split without LARGEADDRESSAWARE) to see whether this has an
> influence on this memory problem. 
> My specs are:	wine-1.3.25, AMD X2 2x3.0GHz, 4GB RAM (DDR2-800),
> GeForce GTX 285 (with NV proprietary driver 280.11), Creative SB X-FI.

More information about the wine-users mailing list