Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMemoryLimit ¶
CheckMemoryLimit returns an error if memory usage exceeds the limit
Types ¶
type MemoryError ¶
MemoryError represents a memory limit error
func (*MemoryError) Error ¶
func (e *MemoryError) Error() string
type MemoryMonitor ¶
type MemoryMonitor struct {
// contains filtered or unexported fields
}
MemoryMonitor provides memory monitoring capabilities
func NewMemoryMonitor ¶
func NewMemoryMonitor(limitMB int64) *MemoryMonitor
NewMemoryMonitor creates a new memory monitor with the specified limit in MB
func (*MemoryMonitor) GetMemoryLimit ¶
func (mm *MemoryMonitor) GetMemoryLimit() int64
GetMemoryLimit returns the configured memory limit in MB
func (*MemoryMonitor) GetMemoryUsage ¶
func (mm *MemoryMonitor) GetMemoryUsage() float64
GetMemoryUsage returns current memory usage in MB
func (*MemoryMonitor) IsWithinLimit ¶
func (mm *MemoryMonitor) IsWithinLimit() bool
IsWithinLimit checks if current memory usage is within the configured limit
func (*MemoryMonitor) SetLimit ¶
func (mm *MemoryMonitor) SetLimit(limitMB int64)
SetLimit updates the memory limit in MB
Click to show internal directories.
Click to hide internal directories.