memory

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProtectedProcesses

func GetProtectedProcesses() map[string]bool

GetProtectedProcesses returns the map of critical processes

func IsSystemOrDriver

func IsSystemOrDriver(p *process.Process) bool

fixed: added generic checker that handles protection of processes better than GetProtectedProcesses it is still needed to keep GetProtectedprocess() for specific processes outside system store folders IsSystemOrDriver checks if the process provided is a critical Windows or Driver process

Types

type AppStatus added in v0.1.6

type AppStatus struct {
	Directory string `json:"directory"`
	IsExempt  bool   `json:"is_exempt"` // true = Cura ignores it
}

type Manager

type Manager struct {
	CapPercentage   float64
	PresetCap       float64 // the user's configured cap from settings/slider
	RoutineOverride bool    // true when a routine is controlling the cap
	IsActive        bool

	LastForegroundMap map[int32]time.Time  // last seen foreground
	AppMap            map[string]AppStatus // whitelist registry
	// contains filtered or unexported fields
}

func NewManager

func NewManager(initialCap float64) *Manager

func (*Manager) IsStale added in v0.1.5

func (m *Manager) IsStale(p *process.Process, threshold time.Duration) bool

IsStale checks if a process is old enough and not currently in use

func (*Manager) SetCap

func (m *Manager) SetCap(percent float64)

func (*Manager) StartEnforcer

func (m *Manager) StartEnforcer(ctx context.Context)

StartEnforcer uses adaptive frequency to handle rapid RAM spikes.

func (*Manager) StopEnforcer

func (m *Manager) StopEnforcer()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL