Force garbage collection in Python to free memory

前端 未结 2 1952
刺人心
刺人心 2020-12-28 22:40

I have a Python2.7 App which used lots of dict objects which mostly contain strings for keys and values.

Sometimes those dicts and strings are not neede

2条回答
  •  再見小時候
    2020-12-28 23:13

    That might be somewhat useful, using multiprocessing and a library called Ray which uses shared memory to perform multi-gb data sharing between processes. This way is easy to spawn a secondary process and still access the same objects quick and easy from the parent process.

提交回复
热议问题