Reinforcement Learning for Dynamic Memory Allocation