Correct GPU memory allocation

Also take a look at this post: