cgroup memory controller in general is full of traps. For example, it does also count filesystem caches into memory usage, which means just using it as limit against application leaks can get into bad behavior, especially if app relies on that cached file access, any leak will just cause that performance to get worse and worse far before it leaks to the level causing app to be killed.
IIRC tmpfs is also charged to the cgroup that uses it.
It makes sense from memory system perspective (else there would be a ways for cgroup to leak memory usage) but it also leads to many unintuitive debug sessions, and under-utilization of free RAM for caching