mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
feat: adjustable RAM and VRAM caps for the container (#1537)
* feat: adjustable RAM and VRAM caps for the container Performance > Memory gets two sliders: - RAM cap (soft, Steam sessions): when the session is resident above the cap, the session watcher compresses the Steam client into zRAM, waits for its page-out acknowledgment, then compresses the rest of the session (processes that loaded libblsession) if still over. Nothing is closed. Measured at most every 30 s; the client is read back once usage drops below the cap. Invalid values leave the cap off. Needs zRAM swap. - VRAM cap: sets dxgi.maxDeviceMemory ahead of the game's own DXVK_CONFIG, so Direct3D games budget for less video memory. A game profile still wins. Applies from the next session. * fix: back off the RAM cap when paging out cannot get under it A cap below the game's working set was never met, so the watcher paged out the client and the whole session every 30 s for the rest of the session. Usage is still measured every 30 s, but after a page-out that leaves the session over the cap the next one waits twice as long (60 s up to 10 min), resetting once usage is under the cap. The client step is skipped while the client is already under 512 MB resident. * fix: RAM cap covers desktop Steam, signals each group once, no idle churn - Steam opened from the desktop runs the same session watcher, so the cap is exported whenever the Steam client runs, not only in Steam mode. - The second page-out goes to the rest of the session only; Steam was signalled again even when its own step had been skipped as already small. - A cap page-out while no game runs stays paged out. Reading the client back right away pushed it over the cap again and repeated every minute; only a game closing while over the cap still defers a read-back. * fix: RAM cap marks the client packed only when it compressed it When the cap skipped the client as already small during a game, it still recorded the client as packed, so the regular in-game client page-out waited up to 300 s for a page-out that never happened. --------- Co-authored-by: jazzyjames <182448902+jazzyjamesgames@users.noreply.github.com>
This commit is contained in:
1 parent
dfe8227f49
commit
2be08bc67d
10 files changed
+180
-13
No files matched your search
@@ -152,6 +152,8 @@ class FrontEndActivity : ComponentActivity() {
|
||||
private var syncFallback by mutableStateOf(true)
|
||||
private var fsyncFirst by mutableStateOf(false)
|
||||
private var gamescopeRealtime by mutableStateOf(false)
|
||||
private var ramCapMb by mutableStateOf(0)
|
||||
private var vramCapMb by mutableStateOf(0)
|
||||
private var gpuClockPin by mutableStateOf(false)
|
||||
private var prootNoSeccomp by mutableStateOf(false)
|
||||
private var prootFastPath by mutableStateOf(true)
|
||||
@@ -1799,6 +1801,10 @@ class FrontEndActivity : ComponentActivity() {
|
||||
fsyncFirst = fsyncFirst,
|
||||
gamescopeRealtime = gamescopeRealtime,
|
||||
gpuClockPin = gpuClockPin,
|
||||
ramCapMb = ramCapMb, vramCapMb = vramCapMb,
|
||||
deviceRamMb = (android.app.ActivityManager.MemoryInfo()
|
||||
.also((getSystemService(ACTIVITY_SERVICE) as android.app.ActivityManager)::getMemoryInfo).totalMem / (1024 * 1024)).toInt(),
|
||||
ramCapAvailable = com.droiddeck.launcher.core.ZramSupport.supported(),
|
||||
prootNoSeccomp = prootNoSeccomp, prootFastPath = prootFastPath, cursorComposite = cursorComposite,
|
||||
guestHostname = guestHostname, phantomWarning = phantomWarning,
|
||||
onClientOverride = { on -> SessionPrefs.setClientCpusOverride(this, on); clientOverride = on },
|
||||
@@ -1812,6 +1818,8 @@ class FrontEndActivity : ComponentActivity() {
|
||||
onFsyncFirst = { on -> SessionPrefs.setFsyncFirst(this, on); fsyncFirst = on },
|
||||
onGamescopeRealtime = { on -> SessionPrefs.setGamescopeRealtime(this, on); gamescopeRealtime = on },
|
||||
onGpuClockPin = { on -> SessionPrefs.setGpuClockPin(this, on); gpuClockPin = on },
|
||||
onRamCapMb = { mb -> SessionPrefs.setRamCapMb(this, mb); ramCapMb = mb },
|
||||
onVramCapMb = { mb -> SessionPrefs.setVramCapMb(this, mb); vramCapMb = mb },
|
||||
onProotNoSeccomp = { on -> SessionPrefs.setProotNoSeccomp(this, on); prootNoSeccomp = on },
|
||||
onProotFastPath = { on -> SessionPrefs.setProotFastPath(this, on); prootFastPath = on },
|
||||
onCursorComposite = { on -> SessionPrefs.setCursorComposite(this, on); cursorComposite = on },
|
||||
@@ -2007,6 +2015,8 @@ class FrontEndActivity : ComponentActivity() {
|
||||
syncFallback = SessionPrefs.syncFallback(this)
|
||||
fsyncFirst = SessionPrefs.fsyncFirst(this)
|
||||
gamescopeRealtime = SessionPrefs.gamescopeRealtime(this)
|
||||
ramCapMb = SessionPrefs.ramCapMb(this)
|
||||
vramCapMb = SessionPrefs.vramCapMb(this)
|
||||
gpuClockPin = SessionPrefs.gpuClockPin(this)
|
||||
prootNoSeccomp = SessionPrefs.prootNoSeccomp(this)
|
||||
prootFastPath = SessionPrefs.prootFastPath(this)
|
||||
|
||||
Reference in new issue
Block a user