title: How to access a data structure from a currently running Python process on Linux?
body: <p>I have a long-running Python process that is generating more data than I planned for. My results are stored in a list that will be serialized (pickled) and written to disk when the program completes -- if it gets that far. But at this rate, it's more likely that the list will exhaust all 1+ GB free RAM and the process will crash, losing all my results in the process.</p>
  
  <p>I plan to modify my script to write results to disk periodically, but I'd like to save the results of the currently-running process if possible. Is there some way I can grab an in-memory data structure from a running process and write it to disk?</p>
  
  <p>I found code.interact(), but since I don't have this hook in my code already, it doesn't seem useful to me (<a href="https://stackoverflow.com/questions/1637198/method-to-peek-at-a-python-program-running-right-now">Method to peek at a Python program running right now</a>).</p>
  
  <p>I'm running Python 2.5 on Fedora 8. Any thoughts?</p>
  
  <p>Thanks a lot.</p>
  
  <p>Shahin</p>