http://bugs.winehq.org/show_bug.cgi?id=25428
Summary: Memory allocation issue when working with a PAE kernel Product: Wine Version: 1.3.7 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: iliverez@gmail.com
Created an attachment (id=32366) --> (http://bugs.winehq.org/attachment.cgi?id=32366) Memory allocation test program.
It seems that when using wine with A PAE kernel on a system with enough memory to put PAE into effect (e.g. 5GB), the maximum limit of memory that an application can allocate is about 1.5GB. Using the same kernels on the same system but with 3GB, the limit is 2GB.
I have created a small test that allocates memory with a step of 64MB with a maximum total allocated space of 2GB. Then I compiled it both with winegcc and gcc.
On the 3GB RAM setup, I could reach the MAX value, both with the winegcc and the gcc compiled executable
On the 5GB RAM setup, the winegcc version stopped at ~1.5, while the gcc version reached the MAX value.
Kernels tested: 2.6.31.12-rt21-avlinux-realtime-pae-rev3 2.6.36-liquorix-avlinux-pae
Wine versions tested: 1.3.5, 1.3.7
Known applications affected by this issue: NI Kontakt 4
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2010-12-05 05:05:46 CST --- You should look at /proc/pid/maps and try to determine what's different. Probably more things get allocated in the low 2Gb.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #2 from iliverez@gmail.com 2010-12-05 12:12:30 CST --- (In reply to comment #1)
You should look at /proc/pid/maps and try to determine what's different. Probably more things get allocated in the low 2Gb.
will do and provide more feedback, although for now I can only spot the differences (I don't know what exactly I am looking for). Should I run wine with some specific options to provide more useful information? If so, please advise.
One thing I forgot to mention, to use the attached test, take care to compile with the -O0 option to remove optimizations, so that memory allocation really occurs.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #3 from iliverez@gmail.com 2010-12-07 14:28:54 CST --- Created an attachment (id=32399) --> (http://bugs.winehq.org/attachment.cgi?id=32399) memory maps of test with PAE (5GB RAM)
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #4 from iliverez@gmail.com 2010-12-07 14:30:37 CST --- Created an attachment (id=32400) --> (http://bugs.winehq.org/attachment.cgi?id=32400) memory maps of test without PAE (3GB RAM)
The kernel actually is PAE, but due to 3GB total RAM it seems that PAE does not affect the test
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2010-12-07 17:08:12 CST --- Looks like the kernel doesn't want to map things under 37000000 or so. You could confirm this by running the Linux version of your app until you run out of space. If there's still a big chunk free after that it's a kernel issue.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #6 from iliverez@gmail.com 2010-12-08 12:49:38 CST --- (In reply to comment #5)
Looks like the kernel doesn't want to map things under 37000000 or so. You could confirm this by running the Linux version of your app until you run out of space. If there's still a big chunk free after that it's a kernel issue.
When I run the gcc compiled version, on the 5GB RAM-PAE setup, it allocates 2GB without problem. I 've been using the 2GB max allocation value, because I think this is the memory limit for an application running with wine and I wanted to have a common ground for the test when it is gcc and winegcc compiled.
If I raise the max memory allocation value, I can go up to 3GB allocation, which is the max that a userspace app can get, no matter if the kernel is PAE or not. Also when the test is gcc compiled and runs with 5GB RAM available, the kernel maps things in the low memory range (see new attachment).
When I reach the 3GB limit for the test (gcc compiled, 5GB PAE), the system has about 1.5GB free RAM. So I guess that in this case, there is enough free memory available, but it is the userspace app memory limit which terminates the test.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #7 from iliverez@gmail.com 2010-12-08 12:51:00 CST --- Created an attachment (id=32414) --> (http://bugs.winehq.org/attachment.cgi?id=32414) memory maps for test, gcc compiled, 5GB RAM, PAE kernel
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2010-12-08 16:46:45 CST --- Maybe the high load address for the wine loader confuses it. You could try building the test app with the same -Wl,--section-start option that the wine loader uses.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #9 from iliverez@gmail.com 2010-12-09 04:48:37 CST --- (In reply to comment #8)
Maybe the high load address for the wine loader confuses it. You could try building the test app with the same -Wl,--section-start option that the wine loader uses.
Could you provide some more info? Where can I find these values?
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2010-12-09 05:34:00 CST --- Link your binary with -Wl,--section-start,.interp=0x7bf00400.
Actually I noticed your test app is using malloc, to test this issue you should use mmap instead.
http://bugs.winehq.org/show_bug.cgi?id=25428
--- Comment #11 from butraxz@gmail.com 2013-06-21 15:17:11 CDT --- This ticket has not been updated for over 900 days.
Is this still an issue in wine version 1.6-rc3 or higher or is this to be closed as abandoned ?
https://bugs.winehq.org/show_bug.cgi?id=25428
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |wylda@volny.cz Resolution|--- |ABANDONED
--- Comment #12 from Wylda wylda@volny.cz --- Abandoned.
https://bugs.winehq.org/show_bug.cgi?id=25428
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Wylda wylda@volny.cz --- Closing - abandoned.