Not sure if this is related or not to your issue, but we had a problem with exhausting memory when grabbing images that would cause the robot code to crash and burn after running for a certain time period.
We found a fix (or work around) by invoking the free() method on the image objects returned after we were done with the image. The following provides an idea of what we did.
Code:
// Grab image from USB camera and push out to camera server
// for smart dashboard display
Image frame = NIVision.imaqCreateImage(ImageType.IMAGE_RGB, 0);
usbCamera.getImage(frame);
cameraServer.setImage(frame);
// Program crashes with out of memory issue if we remove this line
frame.free();
I'm not really sure if calling free() is required on image objects (in Java you would hope that resources would be automatically freed by the garbage collector), I just know that our problem went away once we started invoking free().
Again, not sure if this is related to the problem you are seeing (I didn't see anything in your error messages about running out of memory), but it might be something to try.
Good luck.