func NewMemoryThresholdNotifier(threshold evictionapi.Threshold, cgroupRoot string, factory NotifierFactory, handler func(string)) (ThresholdNotifier, error) {
	cgroups, err := cm.GetCgroupSubsystems()
	if err != nil {
		return nil, err
	}
	cgpath, found := cgroups.MountPoints["memory"]
	if !found || len(cgpath) == 0 {
		return nil, fmt.Errorf("memory cgroup mount point not found")
	}
	if isAllocatableEvictionThreshold(threshold) {
		// for allocatable thresholds, point the cgroup notifier at the allocatable cgroup
		cgpath += cgroupRoot
	}
	return &memoryThresholdNotifier{
		threshold:  threshold,
		cgroupPath: cgpath,
		events:     make(chan struct{}),
		handler:    handler,
		factory:    factory,
	}, nil
}
// NewMemoryThresholdNotifier creates a ThresholdNotifier which is designed to respond to the given threshold.
// UpdateThreshold must be called once before the threshold will be active.
NewMemoryThresholdNotifier creates a ThresholdNotifier which is designed to respond to the given threshold.
UpdateThreshold must be called once before the threshold will be active.
// NewMemoryThresholdNotifier creates a ThresholdNotifier which is designed to respond to the given threshold . // UpdateThreshold must be called once before the threshold will be active .
func NewMemoryThresholdNotifier(threshold evictionapi.Threshold, cgroupRoot string, factory NotifierFactory, handler func(string)) (ThresholdNotifier, error) {
	cgroups, err := cm.GetCgroupSubsystems()
	if err != nil {
		return nil, err
	}
	cgpath, found := cgroups.MountPoints["memory"]
	if !found || len(cgpath) == 0 {
		return nil, fmt.Errorf("memory cgroup mount point not found")
	}
	if isAllocatableEvictionThreshold(threshold) {
		cgpath += cgroupRoot
	}
	return &memoryThresholdNotifier{
		threshold:  threshold,
		cgroupPath: cgpath,
		events:     make(chan struct{}),
		handler:    handler,
		factory:    factory,
	}, nil
}
func NewMemoryThresholdNotifier ( threshold evictionapi . Threshold , cgroupRoot string , factory NotifierFactory , handler func ( string ) ) ( ThresholdNotifier , error ) { cgroups , err := cm . GetCgroupSubsystems ( ) if err != nil { return nil , err } cgpath , found := cgroups . MountPoints [ " " ] if ! found || len ( cgpath ) == 0 { return nil , fmt . Errorf ( " " ) } if isAllocatableEvictionThreshold ( threshold ) { cgpath += cgroupRoot } return & memoryThresholdNotifier { threshold : threshold , cgroupPath : cgpath , events : make ( chan struct { } ) , handler : handler , factory : factory , } , nil }
NewMemoryThresholdNotifier creates a ThresholdNotifier which is designed to respond to the given threshold.
NewMemoryThresholdNotifier creates a ThresholdNotifier which is designed to respond to the given threshold .
// for allocatable thresholds, point the cgroup notifier at the allocatable cgroup