Hi everyone,
I am working on a custom tool for ArcGIS which will integrate with ArcView. The tool is developped using C# and basically connects to an SQL database, fetches data to a local data structure, performs a great deal of statistical analysis and then displays the results as a new layer.
The crash happens during this code's execution.
LinkedList<SegmentDbRecord> segmentData = new LinkedList<SegmentDbRecord>();
while( dataReader.Read() )
{
SegmentDbRecord record = new SegmentDbRecord();
record.first_stop_id = dataReader.GetInt32(0);
record.first_stopway = dataReader.GetString(1);
record.first_stopway_X = dataReader.GetString(2);
record.second_stop_id = dataReader.GetInt32(3);
record.second_stopway = dataReader.GetString(4);
record.second_stopway_X = dataReader.GetString(5);
record.segment_start = Tools.timeToFloat((DateTime)dataReader.GetValue(6));
record.segment_finish = Tools.timeToFloat((DateTime)dataReader.GetValue(7));
record.stop1_long = dataReader.GetFloat(8);
record.stop1_lat = dataReader.GetFloat(9);
record.stop2_long = dataReader.GetFloat(10);
record.stop2_lat = dataReader.GetFloat(11);
record.max_speed = dataReader.GetInt32(12);
record.avg_speed = dataReader.GetInt32(13);
record.route_hnd = dataReader.GetInt32(14);
record.seq_1 = dataReader.GetInt32(15);
record.seq_2 = dataReader.GetInt32(16);
record.route_name = dataReader.GetString(17);
segmentData.AddFirst(record);
}
At this stage, I'm just saving the query's results inside a linked list. I'm pretty sure the crash happens during memory allocation but I know there is still plenty of memory left and the query is not returning such a large dataset. Running a simple loop allocating new "records" also crashes very fast. Do any of you know of a built-in protection in the ArcGIS runtime that could prevent me from allocating more than a certain amount of memory ?
Thank you !