With a lots of Out-of-memory errors I have been getting, I decided to try optimizing the memory usage to help reduce the problem;
- Grid coordinate (GridIndex) size is reduced from 4 to 2 bytes.
Grid size is now limited to 128×128.
- Weight data (RouteWeight) size is reduced from 16 to 8 bytes.
Finally, I have also remove dependancy of generic C# LinkedList class from my Tree data storage (SortedTree); By replacing SortedTreeNode.Children with internal child and sibling variables (FirstChild, LastChild, NextSibling and PreviousSibling). This last change result in approximately 50 – 100 MB reduction in memory usage.