Repository navigation
fix(libkernel): raise the open file soft limit on Linux - #1645
Merged
oneandonlydean merged 1 commit intoOct 10, 2026
Merged
Conversation
Each direct memory backing keeps a memfd open, so a title such as Dreaming Sarah (PPSA02929) holds about 1100 descriptors at startup. With the systemd default soft limit of 1024, later opens fail with EMFILE: memfd_create throws "create direct memory backing: Too many open files", or the title's fopen returns NULL and it faults in fread. libkernel now raises the RLIMIT_NOFILE soft limit to the hard limit when it is loaded, before the title creates any descriptor, and throws if the limit cannot be read or raised.
XairRrR
force-pushed
the
fix/raise-open-file-limit
branch
from
October 8, 2026 15:38
b45a99f to
df3aa1a
Compare
This was referenced Oct 8, 2026
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
This was referenced Oct 8, 2026
Contributor
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…imit fix(libkernel): raise the open file soft limit on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Each direct memory backing keeps a memfd open, so a title such as Dreaming Sarah (PPSA02929) holds about 1100 descriptors at startup and about 1180 once in game. With the systemd default soft
RLIMIT_NOFILEof 1024, later opens fail withEMFILE:memfd_createthrows "create direct memory backing: Too many open files", or the title'sfopenreturns NULL and it faults infread.libkernel now raises the soft limit to the hard limit when it is loaded, before the title creates any descriptor, and throws if the limit cannot be read or raised. If the hard limit itself is 1024 the title still runs out of descriptors, as before. Nothing in
coreuses POSIXselect(), so descriptors above 1023 are safe.Environments that already raise the soft limit (some IDE terminals, CI runners) do not show it; it reproduces from a default desktop terminal or with
ulimit -Sn 1024.Tested
Arch Linux (kernel 7.2, RTX 4070 Ti SUPER), Dreaming Sarah (PPSA02929), soft limit 1024 unless stated:
main(4b005b2): crashes at startup on 3/3 runs; the process reaches exactly 1024 open descriptors before it diesmainwith soft limit 4096: runs, peaking at about 1180 open descriptorsctest: 463/463 passed;tools/check_conventions.py --base origin/mainpassedChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)