AnsweredAssumed Answered

Trimble SDK Memory Usage

Question asked by Sean Mackie on Jan 24, 2019

I am working with the Trimble SDK version 3.6 and am having an issue with the memory use of the Sensor object. When trying to connect to the sensor and failing (because the theodolite is not plugged in) memory is used and not freed. This can be seen in the example application TurnToPixelSample. If you try to connect to the theodolite and fail repeatedly you will use up all the memory of your computer until it crashes. The relevant code is pretty simple:

 

ConnectionType connection_type = ConnectionType.Usb;
ConnectionSettings connection_settings = new ConnectionSettings(connection_type);

 

try
{
      sensor.Connect(connection_settings);   // Sensor object after successful drivers
}
catch (SensorException)
{
   sensor.CancelConnect();
   sensor.Dispose();
}

 

Nothing in this code frees any memory used by the sensor object. Please help.

 

-Sean

Outcomes