[Bug 44375] New: High Virtual Memory crashing many 32bit games.

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 44375] New: High Virtual Memory crashing many 32bit games.

Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

            Bug ID: 44375
           Summary: High Virtual Memory crashing many 32bit games.
           Product: Wine
           Version: unspecified
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: -unknown
          Assignee: [hidden email]
          Reporter: [hidden email]
      Distribution: ---

I've been noticing this in many games although could never confirm where the
issue was coming from, many games would just crash after a period of time.

Recently been investigating this issue and it seems to affect a lot of titles.
The games in question would work perfectly until at some point they will just
crash with an error.

The worst ones so far are - Legend of Grimrock 2 and Race Driver: GRID

Meanwhile there are the ones which will work fine (sometimes even a couple of
hours), then crash when they reach 4GB Virtual Memory used, examples are:

Path of Exile
Dragon Age: Origins
NecroVisioN


It is worth noting that reducing the graphics details also reduces the amount
of virtual memory used and prolongs the crash.

I noticed another old bug report such as this:
https://bugs.winehq.org/show_bug.cgi?id=10778 maybe it's somewhat related.

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] High Virtual Memory crashing many 32bit games.

Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #1 from Ganni87 <[hidden email]> ---
A video I recorded earlier today, showing the virtual memory hitting 4GB and
game crashing along with it:
https://drive.google.com/file/d/12ImU1RuMSGF9Jpen964cHntRVG9gJ-l5/view

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Many 32-bit applications crash when they exhaust their VM addressing space

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

Matteo Bruni <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|High Virtual Memory         |Many 32-bit applications
                   |crashing many 32bit games.  |crash when they exhaust
                   |                            |their VM addressing space

--- Comment #2 from Matteo Bruni <[hidden email]> ---
Yeah, I'm not sure we can do much about it in general, unless there is some
memory leak in Wine.

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Many 32-bit applications crash when they exhaust their VM addressing space

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Many 32-bit applications crash when they exhaust their VM addressing space

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

mirh <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #3 from mirh <[hidden email]> ---
If those applications are so stupid to allocate more than they should, then
that's their fault.. And I think it's totally normal they crash.

*OTOH* I don't think such a thing is happening under Windows.
So, I guess like a leak is indeed there hidden somewhere.

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

Anastasius Focht <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
                 CC|                            |[hidden email]
             Status|UNCONFIRMED                 |NEEDINFO
     Ever confirmed|0                           |1
            Summary|Many 32-bit applications    |Some 32-bit games crash
                   |crash when they exhaust     |when they exhaust their VM
                   |their VM addressing space   |addressing space (Path of
                   |                            |Exile, Dragon Age: Origins,
                   |                            |NecroVisioN)

--- Comment #4 from Anastasius Focht <[hidden email]> ---
Hello folks,

"Many 32-bit applications crash when they exhaust their VM addressing space" is
an outrageous claim for the "many" part.

I've analysed thousands of 32-bit applications/games for many years with the
Wine project and encountered only a handful with the issue of running out of
memory. From these almost all of them were stupid application or graphics
driver bugs (example: nvidia drivers leaking gl memory).

Lowering importance to "normal" and refining summary.

Also you didn't even specify your exact host environment and Wine version.

Regards

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #5 from [hidden email] ---
(In reply to Anastasius Focht from comment #4)

> Hello folks,
>
> "Many 32-bit applications crash when they exhaust their VM addressing space"
> is an outrageous claim for the "many" part.
>
> I've analysed thousands of 32-bit applications/games for many years with the
> Wine project and encountered only a handful with the issue of running out of
> memory. From these almost all of them were stupid application or graphics
> driver bugs (example: nvidia drivers leaking gl memory).
>
> Lowering importance to "normal" and refining summary.
>
> Also you didn't even specify your exact host environment and Wine version.
>
> Regards

In my case confirm that too, however many apps could potentially show this
error (high graphic preferences can detonate this situation) and yeah this is
apps error but many of this apps not be rewrite

And wine stay above windows limitations, maybe can consider if this scenary is
possible and possible work in something to fix

Is possible allocate more than 4gb of virtual in 32 bit app ?

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #6 from [hidden email] ---
However samurai warriors 4 II is interesting because use 4.0gb of virtual
memory and dont crash in test

https://imgur.com/dqaSCF7

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

tokktokk <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

Matteo Bruni <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #7 from Matteo Bruni <[hidden email]> ---
*** Bug 46265 has been marked as a duplicate of this bug. ***

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

Kai Krakow <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #8 from Kai Krakow <[hidden email]> ---
I think this a combination of different problems and depends a lot of external
libraries used. I do not have the references but from memory let's summarize:

1. The nvidia driver and its interaction with glibc makes this problem worse
because it needs to map driver address space into the process. With some driver
update this problem has been addressed but it didn't fix it, it only reduced
the impact. Other drivers may show similar behavior. You can probably only
reduce graphics details to work around this but you cannot completely eliminate
the problem. That's not a wine bug.

2. The pulseaudio driver may allocate multiple shared memory segments and map
them into the address space of the application. This is especially apparent if
the application opens multiple audio channels. By default, each shared memory
segment is 64 MB in most pulseaudio/distribution defaults. This will exhaust
32-bit address space very fast. You can reduce the impact of this by lowering
the pulseaudio shm size in `/etc/pulse/daemon.conf` to 1M or 2M:
`shm-size-bytes = 2097152`. This should have no negative impact on audio
playback. OTOH, you could try disabling pulseaudio usage altogether but this
has other negative consequences because applications can no longer share the
audio device properly (depending on your sound card driver). So, that's also
not a wine bug.

3. If using DXVK, you may end up with early address space exhaustion because
DXVK allocates memory using a chunk allocator (chunks of at least 16 MB).
Application that only do small allocations but require a lot of different chunk
types may end up with a lot of wasted space. There's not much to do about this
because it is a requirement of Vulkan and for performance to do it this way.
Maybe DXVK could reduce the minimum chunk size in 32-bit address space but I
don't think this will help a lot, it may only fragment allocations more and
introduce even more wasted space. I could imagine that the nvidia driver has
some similar issues regarding memory management (see point 1). DXVK is not part
of wine, so that's not a wine bug.

In conclusion, this is probably not a wine bug. And when I followed the
discussions about this, the devs pointed out that there's not much that can be
done about it with wine being a low-level API layer between Windows and Linux.
Windows puts some constraints on how address space layout has to be which is
mostly incompatible with how Linux handles layout. So memory allocations on
both sides work against each other, resulting in non-optimal address space
usage.

That being said, most of those applications failing in wine with allocation
errors can be forced into failing in Windows, too. It just fails in Wine much
more early. Skyrim and The Witcher 2 come to mind here. In the end, that's
application bugs because those apps don't expect memory allocations to fail and
as a result they crash.

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #9 from mirh <[hidden email]> ---
Is there some easy way to see the "share of memory allocation"?
I mean.. 1 and 3 aren't really *that* fundamentally hard limits (being
restricted to just one driver, and one optional api)

But tbh I'd like for somebody to ask to the freedesktop guys of a saner default
value (512 MB just for playback of 8 channels seems completely nuts)
And coming up with hard numbers would help I guess.

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #10 from Kai Krakow <[hidden email]> ---
Pulseaudio just uses the OS defaults...

But before nagging the freedesktop guys, under the assumption that my comment
was constructed from memories, can anyone confirm that disabling pulseaudio or
reducing shm size improves the situation?

I've also read that debug info in a compiled wine distribution can introduce
memory overhead. Thus I recompiled my own version without debug info. But I
currently don't play 32 bit titles that expose this problem, so I cannot
currently check this.

My own version is here (includes Proton):
https://github.com/kakra/wine-proton/releases

Some of the 32-bit memory issues are documented, and I collected commits around
this problem to mitigate those problems:
https://github.com/kakra/wine-proton/blob/rebase/proton_3.16/README.md

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #11 from mirh <[hidden email]> ---
(In reply to Kai Krakow from comment #10)
> Pulseaudio just uses the OS defaults...

Sorry, I hadn't understood that we weren't talking about the actual defaults
for shm-size-bytes, but instead.. I guess some whatever linux default for
/dev/shm.

I also found this interesting thing, while looking at their docs btw
https://www.spinics.net/lists/pulse-audio/msg24979.html

...
Anyway, I'm told mass effect 1 frequently hits memory issues.
Using OpenAL (which wine passthrough to native openal-soft) might have
something to do with it, considering AFAIU it's far less "sparing with
channels" than other APIs. Forcing the game dlls own software stereo renderer
is reported to make things better indeed.

p.s. you should make slightly clearer in your repo that a "32-bit user" means
_of applications_ not the OS/kernel

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

Manoa <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #12 from Manoa <[hidden email]> ---
In conclusion, this is probably not a wine bug. And when I followed the
discussions about this, the devs pointed out that there's not much that can be
done about it with wine being a low-level API layer between Windows and Linux.
Windows puts some constraints on how address space layout has to be which is
mostly incompatible with how Linux handles layout. So memory allocations on
both sides work against each other, resulting in non-optimal address space
usage.

so what are we supposed to do about it ? nothing ? if your problem is address
space layout then make a kernel patch that fixes the linux address space layout
no ?

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


Reply | Threaded
Open this post in threaded view
|

[Bug 44375] Some 32-bit games crash when they exhaust their VM addressing space ( Path of Exile, Dragon Age: Origins, NecroVisioN)

Wine - Bugs mailing list
In reply to this post by Wine - Bugs mailing list
https://bugs.winehq.org/show_bug.cgi?id=44375

--- Comment #13 from Manoa <[hidden email]> ---
or better yet, manage VA inside wine itself and don't let the kernel do it

--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.