title: TStringList of objects taking up tons of memory in Delphi XE
body: <p>I'm working on a simulation program.</p>
  
  <p>One of the first things the program does is read in a huge file (28 mb, about 79'000 lines,), parse each line (about 150 fields), create a class for the object, and add it to a TStringList.</p>
  
  <p>It also reads in another file, which adds more objects during the run. At the end, it ends up being about 85'000 objects.</p>
  
  <p>I was working with Delphi 2007, and the program used a lot of memory, but it ran OK. I upgraded to Delphi XE, and migrated the program over and now it's using a LOT more memory, and it ends up running out of memory half way through the run.</p>
  
  <p>So in Delphi 2007, it would end up using 1.4 gigs after reading in the initial file, which is obviously a huge amount, but in XE, it ends up using almost 1.8 gigs, which is really huge and leads to running out and getting the error</p>
  
  <p>So my question is</p>
  
  <ol>
  <li>Why is it using so much memory? </li>
  <li>Why is it using so much more memory in XE than 2007?</li>
  <li>What can I do about this? I can't change how big or long the file is, and I do need to create an object for each line and to store it somewhere</li>
  </ol>
  
  <p>Thanks</p>