What do you mean by “memory error”?
Was it an out of memory error or some memory access violation?
Could you post the complete stack trace and, if possible, a code snippet to reproduce this issue, so that we can debug it?