Wine memory problem

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
felix
Level 2
Level 2
Posts: 45
Joined: Thu Feb 28, 2008 10:04 am

Wine memory problem

Post by felix »

On Mon, Apr 28, 2008 at 09:33:10AM -0500, sumo wrote:
Dan Kegel wrote:
On Mon, Apr 28, 2008 at 6:26 AM, sumo <[email protected]> wrote:
The preloader has nothing to do with physical memory.
You still don't understand the difference between address space
reservation and physical memory allocation.
[
I perfectly understand it. You write to me that this necessary operating for wine preloader!
Thank's. I shall try to change the specified values
You do understand that on Windows every application has it's own 4GB
virtual address space? Where the lower 2GB are available to the process
and upper 2GB are reserved for system use (excluding using the tuning to
make the split 3GB/1GB)?

Wine is reserving the lower 2GB to mimic the windows behaviour. The
alternative being that linux system libraries that are loaded/used by
wine can appear that the addresses in the same space that the process
thinks it has "exclusive" access to do whatever it wants to.

It's less that it is necessary operating for the wine preloader and more
required by windows applications therefore the wine preloader must mimic
the same behaviour that appears on Windows to stop Windows applications
trying to use the address space that already has other librarieslocated
in. Since wine can't alter the Windows programs behaviour, it must
prevent the linux libraries that it uses from being accessible under the
virtual address space that Windows reserves for each process.

If you are curious about this enter "windows virtual address space" into
google and hit the "I'm feeling lucky" button.

--
Darragh

"Nothing is foolproof to a sufficiently talented fool."
sumo
Level 2
Level 2
Posts: 13
Joined: Thu Apr 24, 2008 2:07 am

Re: Wine memory problem

Post by sumo »

Dan Kegel wrote: If you really can't change your kernel, then you're somewhat
screwed. To find out how screwed, try commenting out the line
{ (void *)0x7f000000, 0x02000000 }, /* top-down allocations +
shared heap */
in loader/preloader.c.
- Dan
Modification of this file has not brought results
winepreloader still reserves memory adress up 3.6 GB
What it is necessary to change?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Wine memory problem

Post by vitamin »

sumo wrote:
Dan Kegel wrote: If you really can't change your kernel, then you're somewhat
screwed. To find out how screwed, try commenting out the line
{ (void *)0x7f000000, 0x02000000 }, /* top-down allocations +
shared heap */
in loader/preloader.c.
- Dan
Modification of this file has not brought results
winepreloader still reserves memory adress up 3.6 GB
What it is necessary to change?
You keep repeating again and again like a broken record. Here is your final answer:

NO YOU CAN NOT force Wine to reserve less then 2GB of virtual address space. Wine REALLY needs that memory.

This conversation is over. Fix your system if you want to use Wine.
sumo
Level 2
Level 2
Posts: 13
Joined: Thu Apr 24, 2008 2:07 am

Re: Wine memory problem

Post by sumo »

vitamin wrote: You keep repeating again and again like a broken record. Here is your final answer:

NO YOU CAN NOT force Wine to reserve less then 2GB of virtual address space. Wine REALLY needs that memory.

This conversation is over. Fix your system if you want to use Wine.
Ok, i understand. How to reduce a reserve to 2GB, 2.5 GB....? :D
Dan Kegel

Wine memory problem

Post by Dan Kegel »

On Mon, Apr 28, 2008 at 9:47 PM, sumo <[email protected]> wrote:
Dan Kegel wrote:
If you really can't change your kernel, then you're somewhat
screwed. To find out how screwed, try commenting out the line
{ (void *)0x7f000000, 0x02000000 }, /* top-down allocations +
shared heap */
in loader/preloader.c.
Modification of this file has not brought results
winepreloader still reserves memory adress up 3.6 GB
Sorry. I think the right course for you at this point might
be to hire a wine developer for a day... and the results
might still disappoint; many apps will probably refuse to
run once you're done.

Maybe you should run Wine inside a virtual machine :-)
- Dan
Rico
Moderator
Moderator
Posts: 91
Joined: Sat Feb 23, 2008 12:10 pm

Re: Wine memory problem

Post by Rico »

Just another question to the memory. Is there a chance to get rid of the high memory useage. Some applications crash when the virtual memory is about 4096MB.
Examples: Gothic3, 3DMark03 (in some cases).

I think they crash because they are only 32bit and so they couldn't access the addresses over 4GB.

Just for info the memory usage in 3DMark03:
Mem: 8200992k total, 3747164k used, 4453828k free, 444436k buffers
Swap: 1469908k total, 0k used, 1469908k free, 2042612k cached
Dan Kegel

Wine memory problem

Post by Dan Kegel »

On Thu, May 1, 2008 at 6:32 AM, Rico <[email protected]> wrote:
Just another question to the memory. Is there a chance to get rid of the high memory
useage.
What high memory usage?

We reserve lots of address space, but we don't use lots of memory.

Please don't generalize. The fact that we reserve lots of address
space is not a bug. If you have a real problem with a real application,
please post a bug report.
- Dan
Rico
Moderator
Moderator
Posts: 91
Joined: Sat Feb 23, 2008 12:10 pm

Re: Wine memory problem

Post by Rico »

Dan Kegel wrote: What high memory usage?

We reserve lots of address space, but we don't use lots of memory.

Please don't generalize. The fact that we reserve lots of address
space is not a bug. If you have a real problem with a real application,
please post a bug report.
- Dan
Yeah, that's right, my example shows that. The memory usage is small. But why do applications crash when the VIRTUAL memory is about 4GB?

For example: http://bugs.winehq.org/show_bug.cgi?id=10778
Dan Kegel

Wine memory problem

Post by Dan Kegel »

On Thu, May 1, 2008 at 7:19 AM, Rico <[email protected]> wrote:
why do applications crash when the VIRTUAL memory is about 4GB?

For example: http://bugs.winehq.org/show_bug.cgi?id=10778
That application seems to have a memory leak (or trigger one in wine),
and crashes when it can't allocate any more memory.
Salvador Pedraza
Newbie
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 12:46 pm

Multiple instances of Virtaul Memory

Post by Salvador Pedraza »

Hi,

I understand from this thread that is unavoidable that wine reserve big portion of VM (~3.6 GB).

I am using wine on a VPS with Centos 5.2.
My problem is that my VPS is charging my by all VM (among other resources) used by my server.

In my case running a more or less simple windows application is taking more than 18 GB of VM.

This is the top list (part of it)::

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3274 traditus 29 9 812m 476m 12m S 18.7 23.3 55:35.05 java
4419 traditus 29 9 3615m 8880 6380 S 1.7 0.4 3:47.42 IQConnect.exe
14115 traditus 29 9 10184 796 656 S 0.7 0.0 0:00.02 ping
31222 mysql 29 9 168m 25m 4904 S 0.7 1.2 0:08.24 mysqld
31033 root 29 9 953m 101m 8292 S 0.3 4.9 1:11.42 java
3061 traditus 29 9 95860 1376 836 S 0.0 0.1 0:00.00 crond
3272 traditus 29 9 8672 1120 948 S 0.0 0.1 0:00.00 bash
3273 traditus 29 9 8668 1056 904 S 0.0 0.1 0:00.00 IQServer.sh
3276 traditus 29 9 57688 3492 2300 S 0.0 0.2 0:00.00 sendmail
3277 traditus 29 9 3615m 8528 5672 S 0.0 0.4 0:00.08 IQServer.exe
3342 traditus 29 9 5160 2664 624 S 0.0 0.1 0:26.58 wineserver
3517 traditus 29 9 3607m 2484 1980 S 0.0 0.1 0:00.00 services.exe
3572 traditus 29 9 3607m 2848 2264 S 0.0 0.1 0:00.00 winedevice.exe
3834 traditus 29 9 3609m 5532 4296 S 0.0 0.3 0:01.98 explorer.exe

As you can see any .exe process is taking 3.6 GB each.

Any way to force all of them to use the same Virtual Memory space?

Thanks and regards
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Multiple instances of Virtaul Memory

Post by vitamin »

Salvador Pedraza wrote:Any way to force all of them to use the same Virtual Memory space?
No, that's not how it works. Each process has it's own _virtual_ space.
Salvador Pedraza
Newbie
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 12:46 pm

Post by Salvador Pedraza »

Ok, I see.
Other try, can I then kill some of the wine specific .exe processes once is started? services.exe, winedevice.exe or explorer.exe?

Thanks and regards
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Re: Wine memory problem

Post by Thunderbird »

Rico wrote:
Dan Kegel wrote: What high memory usage?

We reserve lots of address space, but we don't use lots of memory.

Please don't generalize. The fact that we reserve lots of address
space is not a bug. If you have a real problem with a real application,
please post a bug report.
- Dan
Yeah, that's right, my example shows that. The memory usage is small. But why do applications crash when the VIRTUAL memory is about 4GB?

For example: http://bugs.winehq.org/show_bug.cgi?id=10778
Use the latest mmap/malloc patch attached to bug 13335 that will fix your issues.

Roderick
Salvador Pedraza
Newbie
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 12:46 pm

Post by Salvador Pedraza »

Ohh, Excellent.

Can someone give me some indications on how to apply the patch?
I have installed wine-1.0.1-1.el5 downloaded from EPEL

Thanks
John Drescher

Wine memory problem

Post by John Drescher »

On Thu, Apr 30, 2009 at 1:35 PM, Salvador Pedraza
<[email protected]> wrote:
Ohh, Excellent.

Can someone give me some indications on how to apply the patch?
I have installed wine-1.0.1-1.el5 downloaded from EPEL
For a patch you will have to build wine from source. Check the wiki on
how to do that. And while your at it you should use the current wine
1.1.20 instead of outdated 1.0.1.

John
Salvador Pedraza
Newbie
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 12:46 pm

Post by Salvador Pedraza »

Hi,

Finally I managed to build wine (1.1.20) on Centos 5.2 x86_64 and applied patch 20483 (0001-Ported-mmap-patch-to-wine-1.1.19.patch) of bug 13335.
But unfortunatelly I get the same performance: each .exe process get 3.6 GB of Virtual memory.

Any other suggestion?

Thanks,

Salva
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The patch fixes apps which get not enough memory. Wine will always require that 3.6GB of virtual memory. It is not a bug and all and can't be changed. As Dan already pointed out what you want is a way to restrict the amount of physical memory a program can use and not limit this.
Locked