safe_malloc Error - how q3map2 handles 1GB more RAM

(Krischan) #1

This is a workaround for the safe_malloc Error in the Light stage in a Windows 7 64bit environment, if you get something like this:

— SetupTraceNodes —
************ ERROR ************
safe_malloc failed on allocation of 957874176 bytes
It doesn’t solve problems if you have too complex maps but it could expand the amount of memory q3map2 can use by 1GB avoiding the use of the lomem switch. I simply “patched” the q3map2.exe header with the “App can handle > 2GB address space” flag. Without that, q3map2 always crashed wenn the memory consumption reached 2GB. Now it crashes at about 3GB. A 64bit q3map2 release would be much better, but this workaround here could work for some people, too.

I tested it with the latest q3map2.exe from Netradiant, you should make a backup of it before you start if it doesn’t work:

  1. Download the CFF Explorer Suite
  2. Open CFF Explorer and then open your q3map2.exe file.
  3. Go to the “File Header” section (under Nt Headers)
  4. click the “Click here” on the Characteristics row on the right hand
  5. check the “App can handle >2gb addressest” box, then click OK
  6. go to “Save as”, and then rename your existing q3map2.exe (for backup)
  7. Save the current version as q3map2.exe

(Donnovan) #2


But why “App can handle >2gb addressest” is unchecked by default?

(.Chris.) #3

Don is making ET maps now?


obsidian do we still need this with the new settings?

(Mateos) #5

Another probable cause:

As for the workaround, when the 1.6.4 will be released, I don’t think it will be needed :slight_smile:

(obsidian) #6

Indeed not, the upcoming version GtkRadiant 1.6.4 will have both 32-bit and 64-bit compilers for Windows (Linux and Mac users already have 64-bit versions). So if you’re on a 64-bit system, no need for -lomem or this funny hack. Just choose the right compiler you want to use and everything is a piece of cake.

(Mateos) #7

Could you explain why you registered to resurrect this topic with basic mapping knowledge?

GtkRadiant 1.6.4 includes a x64 compiler now btw.


Thanks this thread is money

(Loffy) #9

Suggested solution confirmed here too.