mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-22 19:56:08 +03:00
config: add cgroup memory limit config
This commit is contained in:
@ -57,10 +57,11 @@ pub fn init(app: *App) ![]const u8 {
|
|||||||
// of "max" because it's a soft limit that can be exceeded and
|
// of "max" because it's a soft limit that can be exceeded and
|
||||||
// can be monitored by things like systemd-oomd to kill if needed,
|
// can be monitored by things like systemd-oomd to kill if needed,
|
||||||
// versus an instant hard kill.
|
// versus an instant hard kill.
|
||||||
// try internal_os.cgroup.configureMemoryLimit(transient, .{
|
if (app.config.@"linux-cgroup-memory-limit") |limit| {
|
||||||
// // 1GB
|
try internal_os.cgroup.configureMemoryLimit(transient, .{
|
||||||
// .high = 1 * 1024 * 1024 * 1024,
|
.high = limit,
|
||||||
// });
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return transient;
|
return transient;
|
||||||
}
|
}
|
||||||
|
@ -1012,6 +1012,15 @@ keybind: Keybinds = .{},
|
|||||||
///
|
///
|
||||||
@"linux-cgroup": LinuxCgroup = .@"single-instance",
|
@"linux-cgroup": LinuxCgroup = .@"single-instance",
|
||||||
|
|
||||||
|
/// Memory limit for any individual terminal process (tab, split, window,
|
||||||
|
/// etc.) in bytes. If this is unset then no memory limit will be set.
|
||||||
|
///
|
||||||
|
/// Note that this sets the "memory.high" configuration for the memory
|
||||||
|
/// controller, which is a soft limit. You should configure something like
|
||||||
|
/// systemd-oom to handle killing processes that have too much memory
|
||||||
|
/// pressure.
|
||||||
|
@"linux-cgroup-memory-limit": ?u64 = null,
|
||||||
|
|
||||||
/// If this is false, then any cgroup initialization (for linux-cgroup)
|
/// If this is false, then any cgroup initialization (for linux-cgroup)
|
||||||
/// will be allowed to fail and the failure is ignored. This is useful if
|
/// will be allowed to fail and the failure is ignored. This is useful if
|
||||||
/// you view cgroup isolation as a "nice to have" and not a critical resource
|
/// you view cgroup isolation as a "nice to have" and not a critical resource
|
||||||
|
Reference in New Issue
Block a user