Hi All, Emilian and Vivian have pointed out a problem with the random buildings - they gobble memory. I'd like to get some advice on whether there's any solution, and also to ask someone with more C++ knowledge than myself to take a look at the code and check I'm not doing something stupid.
The specific problem scenario is starting a KLAX (Los Angeles) which is in the middle of a massive urban area. Using the default random building density, the tiles that are loaded initially when sitting on the runway generates ~ 340k random buildings. Each building consists of between 9 and 12 quads (we have a "basement" at the bottom to handle slopes, 4 walls, and a roof which may be pitched). In turn, each quad has 4 corners, each of which has a position (vec3), a normal (vec3) and a texture coordinate (vec2). So, the absolute minimum memory occupancy of the data for the random buildings is 340k * 10 * 4 * 8 = 108MB. On top of that will be some OSG overhead and the building texture itself. Once you start flying more tiles are loaded (presumably well before any old tiles are unloaded?) so memory occupancy rapidly increases. Flying east from KLAX is particularly bad. Using a higher building density makes the problem much worse, as you need 4X the number of buildings to get double the linear density. I ran out of memory on a 4GB system pretty quickly (and tile loading takes an age - something I need to look at again). So - Does anyone have any bright ideas on what I can do to reduce the base memory occupancy? One option might be to not generate the "basement" if the terrain is level. - Could a fresh pair of eyes take a look at the obj.cxx, mat.cxx and SGBuildingBin.[ch]xx code to see if I've missed something obvious. Thanks, -Stuart ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel