Add a first idea to manage memory with a matrix

It's likely Memory use a bit too much of State but it's still a
beginning.