Q HeapAlloc.

Mike Hearn mike at navi.cx
Sun Jan 16 06:53:31 CST 2005


On Sat, 15 Jan 2005 15:58:30 -0600, Rob Shearman wrote:
> The most like answer is that there is so much fragmentation in your 
> virtual address space that there is no block of contiguous memory free 
> for whatever size is being passed into RtlCreateHeap. Inspecting 
> /proc/<program PID>/maps will give you a clue as to how much 
> fragmentation there is. Unfortunately, if this is your problem, there 
> isn't a good solution to it. Windows is very good at keeping the virtual 
> address space free by bunching all of the system DLLs up at just under 
> the 2Gb barrier. The situation is worsened on Linux, due to prelink 
> randomizing the address space, which is turned on on many modern Linux 
> distros. However, I seem to remember there was a kernel patch written by 
> Ingo Molnar that changes the way mmap and brk allocate virtual address 
> space that could help a lot with this.

Right, this is almost certainly a VMA layout issue. Try an

echo 1 >/proc/sys/vm/legacy_va_layout

and see if that makes any difference. Also try disabling execshield if
present:

echo 0 >/proc/sys/kernel/exec-shield
echo 0 >/proc/sys/kernel/exec-shield-randomize

and finally do an "export LD_USE_LOAD_BIAS=0" before running Wine (this
should disable prelink for that process on recent glibcs).

Finally if you do NOT have a flex-mmap kernel, that may also allow the
win32 heap to grow as much as necessary.

This does beg the question of how much RAM Pirates! expects to be able to
allocate of course ....

thanks -mike




More information about the wine-devel mailing list