The first thing you should do is set the mini-batch size to a smaller number, e.g a half of your current size.
This error occurs when your network need more memory than the available amount in your system.
Hope this help!