https://bugs.winehq.org/show_bug.cgi?id=48482
--- Comment #12 from Federico Dossena info@fdossena.com --- (In reply to Stefan Dösinger from comment #10)
3.2 GB should still leave plenty of room. It could be that HeapAlloc (what msvcrt's malloc uses) fails because the heap structures are corrupted. Running with WINEDEBUG=warn+heap might give some clues.
Wine processes have a huge virtual memory footprint because of areas wine-preloader blocks early on to keep it available for Windows things that need to be at a certain address. After the regular wine main() function starts it might be too late and some Linux library blocks the .exe's load address.
Does the game executable set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag? If not, Wine will block the entire area from 0x80000000-0xffffffff to behave like old 32 bit Windows that had a 2-2 memsplit and no userland pointer would ever have the highest bit set. Linux will see that as 2GB of address space being in use in the process...
I tried setting WINEDEBUG to that value but it doesn't print anything. Do I need a debug build?
KOTOR is not large address aware. I tried forcing that flag but it doesn't delay the crash or anything.