Introduce MemoryPolicy API

Part 1 of #438 
None of them can be `null`, not just the first param.