title: Python - out of memory when reading an xmlfile opened with urllib2
body: <p>I have a python program which gathers affiliate product feeds and saves these as an xml file. Some of those product feeds are really big which results in an out of memory error. This is my code where it happens:</p>
  
  <pre><code>xmlfile = urllib2.urlopen(feed.URL)
  log.info("Opened the file")
  contents = xmlfile.read()
  log.info("Read the file")
  xmlfile.close()
  </code></pre>
  
  <p>"Opened the file" is the last thing to get logged, so reading the file is what's taking so much memory.  I can't do anything about the file size. Also, I run Python 2.7.8 64 bit. That means I'm able to use 4 GB of RAM right? The file size is 450mb, there are no other threads running, no open files. How can it even take this much memory?</p>