title: Python: setting memory limit for a particular function call
body: <p>In a Python script, I want to set a memory limit for a certain function call. I looked at <a href="https://stackoverflow.com/questions/2308091/how-to-limit-python-heap-size">how to limit heap size</a>; however, I don't want to limit the memory of the entire running Python process -- i.e. setting the memory limit before and after the function call. </p>
  
  <p>Is there any way to make a function call with a given amount of memory, so that the memory limit doesn't affect the caller?</p>