The app hanging after reach 1750MB of RAM

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 18 04:43:24 PDT 2017


I am writing app that extract data from DB to array of structures.

	void getSingleTrackInfo()
	{
		
		foreach(item; getTablesGPSSensorList)
		{
			ResultRange result = mysqlconnection.query(sqlquery);
			auto MySQLPointsLonLat = result.array;
			
			carGPSPoint cargpspoint; // create struct
			carGPSPoint [] cargpspoints; // create array of structures

			foreach(i, point;MySQLPointsLonLat)
			{
				cargpspoint.id = point[0].coerce!ulong;
				cargpspoint.recordDate = point[1].coerce!string;
				cargpspoint.velocity = point[2].coerce!double;
				cargpspoint.lat = point[3].coerce!string;
				cargpspoint.lon = point[4].coerce!string;
				cargpspoints ~=cargpspoint;
					
			}

		}
	}


I expected that on every step:
`foreach(item; getTablesGPSSensorList)` structures `carGPSPoint` 
will be recreated and memory will be free. But App after starting 
begin eat memory, and do it till reach 1750 of RAM. After it it's 
not crush, but simply stop other processing.

1. By the code on every iterate `carGPSPoint` should be recreated 
and memory should be free, why this does not happen?
2. How to free my memory?



More information about the Digitalmars-d-learn mailing list