简体   繁体   中英

pycharm, pydev debugger, increasing memory usage

I have a small python program with a footprint of 12 MB when running. The task is mostly waiting for serial data input and updating a fixed memory structure (not growing) with latest data. The memory usage stays the same over time (taskmanager)

If I start the program in debug mode it starts up with about a 50 MB footprint but then increases memory usage with a rate of about 4 MB/sec.

Is this a normal behaviour or is there a way to stop / slow down the memory eating?

I am on w10/64, using python 3.6 and pycharm community 2018.2

Generally if additional memory is used Python will not give this back to the operating system but will retain this for later use. Generally this memory is partitioned and allocated to a pool - cPython uses these pools to later allocate the memory to objects of different sizes.

An increasing memory footprint is nothing to be worried about in Python. To find out more check this blog post by Artem Golubin: https://rushter.com/blog/python-memory-managment/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM