aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache/buffer_cache.h
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-30 04:39:40 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-30 04:39:40 -0400
commitcb4fbb73f8f1d82e4afe996f7c2b0f58c8daa912 (patch)
tree007e0436cc48c8a81c2f184326989694653eabd7 /src/video_core/buffer_cache/buffer_cache.h
parent4ec2e0c5de9710cde97c3f3314f2de09c9bd7d39 (diff)
memory: skip clearing guest memory that is still zero
The kernel clears every page it hands out, and the backing memory is a page-file section the host only gives RAM to once a page is touched. So the clears themselves made every page of a game's heap resident: Mario Kart World (12 GB layout) had a 12.5 GB working set 20 s after boot. HostMemory keeps two bits per 64 KiB of backing: used (handed out by the kernel at least once) and dirty (may hold data). Pages returned to the kernel mark their granules dirty, and a zero clear only touches dirty granules; a granule cleared in full is clean again. A new kernel on the same memory marks everything a previous one used dirty, so leaked processes can't leak data into the next game. KMemoryManager's optimized-process fill and KSharedMemory's clear go through the same path. Mario Kart World, title screen and attract demo, 180 s: working set 20 s in 4.7-6.4 GB instead of 12.5 GB, peak 14-17.6 GB instead of 20.1 GB.
Diffstat (limited to 'src/video_core/buffer_cache/buffer_cache.h')
0 files changed, 0 insertions, 0 deletions