Date Tags Wine

Playing Everquest 2 using Wine, I suffered from the more and more often occurring "out of memory" crashes especially in new zones like RoK or TSO. After reading in the EQ2 forums about various remedies for Windows using the /3GB switch in boot.ini, I looked into Wine wether this could be done with linux too.

Wine is actually ware of the so called LARGEADDRESSAWARE flag, but these "out of memory" errors seem to originate from the nvidia or ati opengl driver allocationg texture memory. It is reserved directly within the driver via the C API and therefore not taken into account by wine.

The current Wine preallocates all memory between 2 and 4GB of the virtual address space in order to simulate the windows memory model. The OpenGL driver apparently can only get the memory below 2GB and therefore only 2GB are available for both, the application and the opengl textures.

The following hack modifies the preallocation to only block memory between 3 and 4GB. This probably leads to a slightly wrong memory model compared to a native Windows, but it gives at least EQ2 1GB more memory to be used by the OpenGL driver.

Since using this patch I have never seen any crash concerning "out of memory" anymore.

After all this is just a temporary workaround for the problem described in http://bugs.winehq.org/show_bug.cgi?id=13335, which will hopefully be fixed soon and my workaround is not needed anymore.

See U in Norrath ;-)

Updated patch, wine-1.3.33 

diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c
index 63a597d..b892c43 100644
--- a/libs/wine/mmap.c
+++ b/libs/wine/mmap.c
@@ -343,7 +343,7 @@ void mmap_init(void)
     struct list *ptr;
     char stack;
     char * const stack_ptr = &stack;
-    char *user_space_limit = (char *)0x7ffe0000;
+    char *user_space_limit = (char *)0xbffe0000;

     reserve_malloc_space( 8 * 1024 * 1024 );