This is actually an "out of C memory" error, not out of Java memory error. So garbage collection is not an issue.
I'm guessing that you are calling DriverStationLCD.updateLCD() fairly frequently. This shouldn't be a problem, except there's a memory leak in FRCControl.setUserDsLcdData().
You can try this fix (open the project sunspotfrcsdk/lib/WPILibJ in NetBeans)
And use this new method implementation:
Quote:
public static void setUserDsLcdData(byte[] bytes, int length, int timeOut) {
Pointer textPtr = new Pointer(bytes.length);
textPtr.setBytes(0, bytes, 0, bytes.length);
setUserDsLcdDataFn.call3(textPtr, length, timeOut);
textPtr.free(); // free c memory
}
|
FYI - there are similar bugs in the Visa class used by the SerialPort class.