prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Potential memory leak on windows
  I was recently running some scripts overnight that failed due to a MemoryError, but was unable to find anything obvious that would be leaking memory in my scripts.
  
  During my investigation process, I have found that the following script increases memory usage by ~1 MB/s while running. If the `await trio.sleep(0)` is replaced by `pass` the process runs at a constant 9.7 MB of memory usage.
  
  ```python
  import trio
  
  async def main():
      while True:
          await trio.sleep(0)
  
  if __name__ == '__main__':
      trio.run(main)
  ```
  
  ## Version Info
  
  Python 3.8.1
  Trio 0.13.0
  Windows 10
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 from setuptools import setup, find_packages
  2 
  3 exec(open("trio/_version.py", encoding="utf-8").read())
  4 
  5 LONG_DESC = """\
  6 .. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg
  7    :width: 200px
  8    :align: right
  9 
  10 The Trio project's goal is to produce a production-quality, `permissively
  11 licensed <https://github.com/python-trio/trio/blob/master/LICENSE>`__,
  12 async/await-native I/O library for Python. Like all async libraries,
  13 its main purpose is to help you write programs that do **multiple
  14 things at the same time** with **parallelized I/O**. A web spider that
  15 wants to fetch lots of pages in parallel, a web server that needs to
  16 juggle lots of downloads and websocket connections at the same time, a
  17 process supervisor monitoring multiple subprocesses... that sort of
  18 thing. Compared to other libraries, Trio attempts to distinguish
  19 itself with an obsessive focus on **usability** and
  20 **correctness**. Concurrency is complicated; we try to make it *easy*
  21 to get things *right*.
  22 
  23 Trio was built from the ground up to take advantage of the `latest
  24 Python features <https://www.python.org/dev/peps/pep-0492/>`__, and
  25 draws inspiration from `many sources
  26 <https://github.com/python-trio/trio/wiki/Reading-list>`__, in
  27 particular Dave Beazley's `Curio <https://curio.readthedocs.io/>`__.
  28 The resulting design is radically simpler than older competitors like
  29 `asyncio <https://docs.python.org/3/library/asyncio.html>`__ and
  30 `Twisted <https://twistedmatrix.com/>`__, yet just as capable. Trio is
  31 the Python I/O library I always wanted; I find it makes building
  32 I/O-oriented programs easier, less error-prone, and just plain more
  33 fun. `Perhaps you'll find the same
  34 <https://github.com/python-trio/trio/wiki/Testimonials>`__.
  35 
  36 This project is young and still somewhat experimental: the overall
  37 design is solid and the existing features are fully tested and
  38 documented, but you may encounter missing functionality or rough
  39 edges. We *do* encourage you do use it, but you should `read and
  40 subscribe to issue #1
  41 <https://github.com/python-trio/trio/issues/1>`__ to get warning and a
  42 chance to give feedback about any compatibility-breaking changes.
  43 
  44 Vital statistics:
  45 
  46 * Supported environments: Linux, macOS, or Windows running some kind of Python
  47   3.5-or-better (either CPython or PyPy3 is fine). \\*BSD and illumos likely
  48   work too, but are not tested.
  49 
  50 * Install: ``python3 -m pip install -U trio`` (or on Windows, maybe
  51   ``py -3 -m pip install -U trio``). No compiler needed.
  52 
  53 * Tutorial and reference manual: https://trio.readthedocs.io
  54 
  55 * Bug tracker and source code: https://github.com/python-trio/trio
  56 
  57 * Real-time chat: https://gitter.im/python-trio/general
  58 
  59 * Discussion forum: https://trio.discourse.group
  60 
  61 * License: MIT or Apache 2, your choice
  62 
  63 * Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html
  64 
  65 * Code of conduct: Contributors are requested to follow our `code of
  66   conduct
  67   <https://trio.readthedocs.io/en/latest/code-of-conduct.html>`_
  68   in all project spaces.
  69 """
  70 
  71 setup(
  72     name="trio",
  73     version=__version__,
  74     description="A friendly Python library for async concurrency and I/O",
  75     long_description=LONG_DESC,
  76     author="Nathaniel J. Smith",
  77     author_email="njs@pobox.com",
  78     url="https://github.com/python-trio/trio",
  79     license="MIT -or- Apache License 2.0",
  80     packages=find_packages(),
  81     install_requires=[
  82         "attrs >= 19.2.0",  # for eq
  83         "sortedcontainers",
  84         "async_generator >= 1.9",
  85         "idna",
  86         "outcome",
  87         "sniffio",
  88         # cffi 1.12 adds from_buffer(require_writable=True) and ffi.release()
  89         "cffi>=1.12; os_name == 'nt'",  # "cffi is required on windows"
  90         "contextvars>=2.1; python_version < '3.7'"
  91     ],
  92     # This means, just install *everything* you see under trio/, even if it
  93     # doesn't look like a source file, so long as it appears in MANIFEST.in:
  94     include_package_data=True,
  95     python_requires=">=3.5",
  96     keywords=["async", "io", "networking", "trio"],
  97     classifiers=[
  98         "Development Status :: 3 - Alpha",
  99         "Intended Audience :: Developers",
  100         "License :: OSI Approved :: MIT License",
  101         "License :: OSI Approved :: Apache Software License",
  102         "Operating System :: POSIX :: Linux",
  103         "Operating System :: MacOS :: MacOS X",
  104         "Operating System :: POSIX :: BSD",
  105         "Operating System :: Microsoft :: Windows",
  106         "Programming Language :: Python :: Implementation :: CPython",
  107         "Programming Language :: Python :: Implementation :: PyPy",
  108         "Programming Language :: Python :: 3 :: Only",
  109         "Programming Language :: Python :: 3.5",
  110         "Programming Language :: Python :: 3.6",
  111         "Topic :: System :: Networking",
  112         "Framework :: Trio",
  113     ],
  114 )
  115
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -86,7 +86,8 @@
           "outcome",
           "sniffio",
           # cffi 1.12 adds from_buffer(require_writable=True) and ffi.release()
  -        "cffi>=1.12; os_name == 'nt'",  # "cffi is required on windows"
  +        # cffi 1.14 fixes memory leak inside ffi.getwinerror()
  +        "cffi>=1.14; os_name == 'nt'",  # "cffi is required on windows"
           "contextvars>=2.1; python_version < '3.7'"
       ],
       # This means, just install *everything* you see under trio/, even if it
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -86,7 +86,8 @@\n         \"outcome\",\n         \"sniffio\",\n         # cffi 1.12 adds from_buffer(require_writable=True) and ffi.release()\n-        \"cffi>=1.12; os_name == 'nt'\",  # \"cffi is required on windows\"\n+        # cffi 1.14 fixes memory leak inside ffi.getwinerror()\n+        \"cffi>=1.14; os_name == 'nt'\",  # \"cffi is required on windows\"\n         \"contextvars>=2.1; python_version < '3.7'\"\n     ],\n     # This means, just install *everything* you see under trio/, even if it\n", "issue": "Potential memory leak on windows\nI was recently running some scripts overnight that failed due to a MemoryError, but was unable to find anything obvious that would be leaking memory in my scripts.\r\n\r\nDuring my investigation process, I have found that the following script increases memory usage by ~1 MB/s while running. If the `await trio.sleep(0)` is replaced by `pass` the process runs at a constant 9.7 MB of memory usage.\r\n\r\n```python\r\nimport trio\r\n\r\nasync def main():\r\n    while True:\r\n        await trio.sleep(0)\r\n\r\nif __name__ == '__main__':\r\n    trio.run(main)\r\n```\r\n\r\n## Version Info\r\n\r\nPython 3.8.1\r\nTrio 0.13.0\r\nWindows 10\r\n\n", "before_files": [{"content": "from setuptools import setup, find_packages\n\nexec(open(\"trio/_version.py\", encoding=\"utf-8\").read())\n\nLONG_DESC = \"\"\"\\\n.. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg\n   :width: 200px\n   :align: right\n\nThe Trio project's goal is to produce a production-quality, `permissively\nlicensed <https://github.com/python-trio/trio/blob/master/LICENSE>`__,\nasync/await-native I/O library for Python. Like all async libraries,\nits main purpose is to help you write programs that do **multiple\nthings at the same time** with **parallelized I/O**. A web spider that\nwants to fetch lots of pages in parallel, a web server that needs to\njuggle lots of downloads and websocket connections at the same time, a\nprocess supervisor monitoring multiple subprocesses... that sort of\nthing. Compared to other libraries, Trio attempts to distinguish\nitself with an obsessive focus on **usability** and\n**correctness**. Concurrency is complicated; we try to make it *easy*\nto get things *right*.\n\nTrio was built from the ground up to take advantage of the `latest\nPython features <https://www.python.org/dev/peps/pep-0492/>`__, and\ndraws inspiration from `many sources\n<https://github.com/python-trio/trio/wiki/Reading-list>`__, in\nparticular Dave Beazley's `Curio <https://curio.readthedocs.io/>`__.\nThe resulting design is radically simpler than older competitors like\n`asyncio <https://docs.python.org/3/library/asyncio.html>`__ and\n`Twisted <https://twistedmatrix.com/>`__, yet just as capable. Trio is\nthe Python I/O library I always wanted; I find it makes building\nI/O-oriented programs easier, less error-prone, and just plain more\nfun. `Perhaps you'll find the same\n<https://github.com/python-trio/trio/wiki/Testimonials>`__.\n\nThis project is young and still somewhat experimental: the overall\ndesign is solid and the existing features are fully tested and\ndocumented, but you may encounter missing functionality or rough\nedges. We *do* encourage you do use it, but you should `read and\nsubscribe to issue #1\n<https://github.com/python-trio/trio/issues/1>`__ to get warning and a\nchance to give feedback about any compatibility-breaking changes.\n\nVital statistics:\n\n* Supported environments: Linux, macOS, or Windows running some kind of Python\n  3.5-or-better (either CPython or PyPy3 is fine). \\\\*BSD and illumos likely\n  work too, but are not tested.\n\n* Install: ``python3 -m pip install -U trio`` (or on Windows, maybe\n  ``py -3 -m pip install -U trio``). No compiler needed.\n\n* Tutorial and reference manual: https://trio.readthedocs.io\n\n* Bug tracker and source code: https://github.com/python-trio/trio\n\n* Real-time chat: https://gitter.im/python-trio/general\n\n* Discussion forum: https://trio.discourse.group\n\n* License: MIT or Apache 2, your choice\n\n* Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html\n\n* Code of conduct: Contributors are requested to follow our `code of\n  conduct\n  <https://trio.readthedocs.io/en/latest/code-of-conduct.html>`_\n  in all project spaces.\n\"\"\"\n\nsetup(\n    name=\"trio\",\n    version=__version__,\n    description=\"A friendly Python library for async concurrency and I/O\",\n    long_description=LONG_DESC,\n    author=\"Nathaniel J. Smith\",\n    author_email=\"njs@pobox.com\",\n    url=\"https://github.com/python-trio/trio\",\n    license=\"MIT -or- Apache License 2.0\",\n    packages=find_packages(),\n    install_requires=[\n        \"attrs >= 19.2.0\",  # for eq\n        \"sortedcontainers\",\n        \"async_generator >= 1.9\",\n        \"idna\",\n        \"outcome\",\n        \"sniffio\",\n        # cffi 1.12 adds from_buffer(require_writable=True) and ffi.release()\n        \"cffi>=1.12; os_name == 'nt'\",  # \"cffi is required on windows\"\n        \"contextvars>=2.1; python_version < '3.7'\"\n    ],\n    # This means, just install *everything* you see under trio/, even if it\n    # doesn't look like a source file, so long as it appears in MANIFEST.in:\n    include_package_data=True,\n    python_requires=\">=3.5\",\n    keywords=[\"async\", \"io\", \"networking\", \"trio\"],\n    classifiers=[\n        \"Development Status :: 3 - Alpha\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Topic :: System :: Networking\",\n        \"Framework :: Trio\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "from setuptools import setup, find_packages\n\nexec(open(\"trio/_version.py\", encoding=\"utf-8\").read())\n\nLONG_DESC = \"\"\"\\\n.. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg\n   :width: 200px\n   :align: right\n\nThe Trio project's goal is to produce a production-quality, `permissively\nlicensed <https://github.com/python-trio/trio/blob/master/LICENSE>`__,\nasync/await-native I/O library for Python. Like all async libraries,\nits main purpose is to help you write programs that do **multiple\nthings at the same time** with **parallelized I/O**. A web spider that\nwants to fetch lots of pages in parallel, a web server that needs to\njuggle lots of downloads and websocket connections at the same time, a\nprocess supervisor monitoring multiple subprocesses... that sort of\nthing. Compared to other libraries, Trio attempts to distinguish\nitself with an obsessive focus on **usability** and\n**correctness**. Concurrency is complicated; we try to make it *easy*\nto get things *right*.\n\nTrio was built from the ground up to take advantage of the `latest\nPython features <https://www.python.org/dev/peps/pep-0492/>`__, and\ndraws inspiration from `many sources\n<https://github.com/python-trio/trio/wiki/Reading-list>`__, in\nparticular Dave Beazley's `Curio <https://curio.readthedocs.io/>`__.\nThe resulting design is radically simpler than older competitors like\n`asyncio <https://docs.python.org/3/library/asyncio.html>`__ and\n`Twisted <https://twistedmatrix.com/>`__, yet just as capable. Trio is\nthe Python I/O library I always wanted; I find it makes building\nI/O-oriented programs easier, less error-prone, and just plain more\nfun. `Perhaps you'll find the same\n<https://github.com/python-trio/trio/wiki/Testimonials>`__.\n\nThis project is young and still somewhat experimental: the overall\ndesign is solid and the existing features are fully tested and\ndocumented, but you may encounter missing functionality or rough\nedges. We *do* encourage you do use it, but you should `read and\nsubscribe to issue #1\n<https://github.com/python-trio/trio/issues/1>`__ to get warning and a\nchance to give feedback about any compatibility-breaking changes.\n\nVital statistics:\n\n* Supported environments: Linux, macOS, or Windows running some kind of Python\n  3.5-or-better (either CPython or PyPy3 is fine). \\\\*BSD and illumos likely\n  work too, but are not tested.\n\n* Install: ``python3 -m pip install -U trio`` (or on Windows, maybe\n  ``py -3 -m pip install -U trio``). No compiler needed.\n\n* Tutorial and reference manual: https://trio.readthedocs.io\n\n* Bug tracker and source code: https://github.com/python-trio/trio\n\n* Real-time chat: https://gitter.im/python-trio/general\n\n* Discussion forum: https://trio.discourse.group\n\n* License: MIT or Apache 2, your choice\n\n* Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html\n\n* Code of conduct: Contributors are requested to follow our `code of\n  conduct\n  <https://trio.readthedocs.io/en/latest/code-of-conduct.html>`_\n  in all project spaces.\n\"\"\"\n\nsetup(\n    name=\"trio\",\n    version=__version__,\n    description=\"A friendly Python library for async concurrency and I/O\",\n    long_description=LONG_DESC,\n    author=\"Nathaniel J. Smith\",\n    author_email=\"njs@pobox.com\",\n    url=\"https://github.com/python-trio/trio\",\n    license=\"MIT -or- Apache License 2.0\",\n    packages=find_packages(),\n    install_requires=[\n        \"attrs >= 19.2.0\",  # for eq\n        \"sortedcontainers\",\n        \"async_generator >= 1.9\",\n        \"idna\",\n        \"outcome\",\n        \"sniffio\",\n        # cffi 1.12 adds from_buffer(require_writable=True) and ffi.release()\n        # cffi 1.14 fixes memory leak inside ffi.getwinerror()\n        \"cffi>=1.14; os_name == 'nt'\",  # \"cffi is required on windows\"\n        \"contextvars>=2.1; python_version < '3.7'\"\n    ],\n    # This means, just install *everything* you see under trio/, even if it\n    # doesn't look like a source file, so long as it appears in MANIFEST.in:\n    include_package_data=True,\n    python_requires=\">=3.5\",\n    keywords=[\"async\", \"io\", \"networking\", \"trio\"],\n    classifiers=[\n        \"Development Status :: 3 - Alpha\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Topic :: System :: Networking\",\n        \"Framework :: Trio\",\n    ],\n)\n", "path": "setup.py"}]}