Introduce MemoryPolicy API

Part 1 of #438 
Also really ugly. Suppressing warning should always come with a comment
```java
@SuppressWarnings("UnusedDeclaration") // Public API.
```