Я занимаюсь разработкой приложения на C # с ограниченной памятью. Я инициализирую большое количество объектов, подобных приведенным ниже, которые имеют несколько свойств, занимающих около 20 МБ. Как я могу уменьшить объем памяти, используемой моим приложением.
public class BusStop
{
private List<BusRoute> busRoutes = new List<BusRoute>();
private string name;
// ... Other properties omitted like Code, ID, Location, etc.
public BusStop(string name)
{
this.name = name;
}
public List<BusStop> BusRoutes
{
get { return this.busRoutes; }
}
public string Name
{
get { return this.name; }
}
}
public class BusRoute
{
private List<BusStop> busStops = new List<BusStop>();
private string name;
// ... Other properties omitted like Code, ID, Location, etc.
public BusStop(string name)
{
this.name = name;
}
public List<BusStop> BusStops
{
get { return this.busStops; }
}
public string Name
{
get { return this.name; }
}
}