fix(libkernel): take the flexible memory size from param.json #4617
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4617"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by poonasor on 2026-10-12T16:50:10Z.
What
The flexible memory budget is a fixed 448 MiB. A title can declare its own in
param.json:A commercial title declares 560 MiB. Since the segments of the title's executable count against the budget, it runs out about 20 minutes after its title screen and writes through the null result:
The title does not reach this point on
mainalone (it stops earlier on missing functions, #4544 and others); the lines are fromc6efe068awith those added on my fork (dev-next).parseParamJsonnow readskernel.flexibleMemorySize(a non-negative integer, bytes; anything else throws), andsceKernelConfiguredFlexibleMemorySize,sceKernelAvailableFlexibleMemorySizeand the flexible maps use it. Without the member, or without aparam.json, the budget stays 448 MiB.Not known and recorded in TechnicalDebt: whether the console takes a larger flexible budget out of the direct memory pool, and which values it accepts.
Tested
Windows 11, MinGW-w64 GCC 15.2, AMD RX 6700 XT.
param_json_parserextended: absentkernel, emptykernel, a valid size, and six rejected forms (non-object, negative, fraction, exponent, string, above uint64). It does not build onmain(noflexibleMemorySizefield) and passes with this change.ctest -R "param_json|guest_memory": 4 of 4 pass.python tools/check_conventions.py --base origin/mainpasses.Not tested: Linux, macOS.
Checklist
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T23:06:23Z.
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.
main)core/libs/prx/libkernel/AppMetadata/include/ParamJsonParser.hppL12core/libs/prx/libkernel/DirectMemory/Export.cppL39, L100-101, L365, L371docs/dev/debt/libkernel.mdL40Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T06:43:00Z.
Windows test: head
55ee567e2merged onto currentmainea2bbefb2(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filterparam_json_parser: param_json_parser passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:45:00Z.
Closing as a duplicate of #4508, which was opened earlier and implements the same thing:
kernel.flexibleMemorySizefromparam.jsonused bysceKernelConfiguredFlexibleMemorySize,sceKernelAvailableFlexibleMemorySizeand the flexible maps, in the same files (ParamJsonParser,DirectMemory/Export.cpp,docs/dev/debt/libkernel.md). It also validates 16 KiB alignment, covers guest-memory accounting in tests and already has review comments.Your evidence (NHL 27 / PPSA34063 declaring 587202560 and the exhaustion log) is useful there: please add it to #4508 as a comment. Welcome to reopen if #4508 ends up not covering your case.
Pull request closed