How to free increased physical memory consumption?

Did Quora's switch to PyPy result in increased memory consumption?

  • If so, how much more memory does PyPy consume compared to CPython? Anyone else who have used both PyPy and CPython can share  their experiences?

  • Answer:

    Yes, but our case is a bit unusual: First off, our PyPy worker processes themselves take approximately 50% more memory than our equivalent CPython worker processes, although we did not do a large amount of tuning of the GC. Regardless, this wasn't the main cause of our memory blowup. In our development, we found that certain functions were not worth being ported from their C libraries to pure Python, things like crypto, lxml, PyML, and a couple other random libraries. Our solution for those functions was to run a parallel CPython process that would do nothing but take arguments via an execnet channel, and output return values via the same execnet channel. The overhead for some of these Python processes, especially for the ones that required a lot of state (for example, PyML) is comparable to the amount of memory taken by the master PyPy process, effectively causing a 2-3x blowup in memory just to maintain the CPython processes; this is our main memory sink for our PyPy branch.

Albert Sheu at Quora Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.