func (c *Cgroups) Memory(h string) ([]string, []string) {
	label := []string{}
	value := []string{}
	var params = []string{
		"memory.usage_in_bytes",
		"memory.memsw.usage_in_bytes",
		"memory.max_usage_in_bytes",
		"memory.memsw.max_usage_in_bytes",
		"memory.limit_in_bytes",
		"memory.memsw.limit_in_bytes",
	}
	for _, p := range params {
		splited := strings.SplitN(p, ".", 2)
		v, err := c.ReadSimple(h, splited[0], p)
		if v != "" && err == nil {
			label = append(label, p)
			value = append(value, v)
		}
	}
	stat, err := c.ReadSimple(h, "memory", "memory.stat")
	if err == nil {
		in := strings.NewReader(stat)
		scanner := bufio.NewScanner(in)
		for scanner.Scan() {
			line := scanner.Text()
			splited := strings.SplitN(line, " ", 2)
			s := fmt.Sprintf("memory.stat.%s", splited[0])
			v := splited[1]
			label = append(label, s)
			value = append(value, v)
		}
	}
	return label, value
}
Memory return cgroups memory values
package cgroups
import (
	"bufio"
	"fmt"
	"strings"
)