Mem usage in Mac OSX

Nick Burns adger44 at
Sun Oct 1 06:30:12 CDT 2006

Im seeing some very odd behaviour in Mac OSX using wine -- and wondered if 
anyone could enlighten me

When I run any application  -- I see it start with ~4GB of VM then depending 
on the app -- it goes upwards of 5.7GB in VM usage (>4GB?) in Activity 
Monitor (usually because of texture loading or other context loading -- so 
this is seen in games where you start moving around a map and it starts 
loading textures into OGL/D3D(->OGL))
Usually when it gets this high -- bad things happen -- basically mallocs 
start to fail, and the app crashes.

I personally dont like the app to crash -- i ha just started playing. So, 
lets say in GTAVC -- thats me in a heli going from Downtown -> New Haiti == 
crash. Thats only a few blocks worth of carnage.

So, I tested a coule theories --
1 - Was it bad OGL calls? **No**, the glTexImage calls looked decent -- some 
even very small (128x128 compressed)
2 - Was it too many mallocs/calloc/reallocs? **No**, none of these were in 
the GB range...
3 - Finally I found out some very large mmaps/vm_allocates (2x256MB 2x512MB) 
taking a significant portion of the VM space away from any system libs.
I tested this out a bit by printing the mmaps/vm_allocates that I was 
getting (found the huge 256/512 MB ones)
So, in mmap.c:175 -- try_mmap_fixed
I put in
printf("len very big -- 0x%08X\n",len);
to cap the mmaps that i was seeing

Yes yes, I realize thats a HORRIBLE thing to do -- but its for the sake of 
testing and science!
This 'cured' my problems in GTAVC -- I no longer crashed (But i would have 
given enough allocations... or time). My VM usage droped from an initial 
~4gb -> ~3gb as I expected

I was unable to track down these specific huge allocations...
And would like some advice on this situation -- from the sages of Wine...

I would like to fix this the correct way
I have no idea what happen on Linux in these cases....

- Nick

More information about the wine-devel mailing list