Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-800

memory increase

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 2.1
    • Component/s: asyncio
    • None
    • Environment:
      python 3.7.5
      pymongo 3.12.0

       

      # 1.runtime_mongos is settings of "replicaSet": "bapi", "readPreference": "secondaryPreferred"
      # 2.I run the flow test, found the mem_usage increase a lot.(1.428GiB / 8GiB) the db has about 10+M data.
      table = motor_asyncio.AsyncIOMotorClient(**settings.runtime_mongos)["name"]["Table"]
      loop = asyncio.get_event_loop()
      async def test():
          cnt = 0
          while True:
             task_ls = await table.find().sort([
       (cls.COL_PRIORITY, pymongo.ASCENDING),
       (cls.COL_START_UTS, pymongo.ASCENDING),
      ]).to_list(None)
              print(len(task_ls))
              await asyncio.sleep(1)
              cnt += 1
              if cnt > 50:
                  gc.collect()
                  cnt = 0
      loop.run_until_complete(test())
      

      I have no idea what happen.

       

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            f811194414@gmail.com Ars Roseregen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: