[issue43375] memory leak in threading ?

2021-03-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks; I missed that one. I'll update the state of this one to mark it as a 
duplicate of #37788.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution:  -> duplicate
superseder:  -> fix for bpo-36402 (threading._shutdown() race condition) causes 
reference leak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-09 Thread Martin Panter


Martin Panter  added the comment:

Sounds the same as Issue 37788, which is still open.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Since Timer thread is never joined, should not it be a daemon?

Possibly, but I think that's a new question/issue. :-) And presumably there's 
no reason you can't make your Timer threads into daemon threads if you have a 
need to.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-03 Thread Igor Mandrichenko


Igor Mandrichenko  added the comment:

Since Timer thread is never joined, should not it be a daemon ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-02 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'm not sure that this counts as a bug.

Each non-daemon thread adds a lock to the threading._shutdown_locks set: 
https://github.com/python/cpython/blob/8b795ab5541d8a4e69be4137dfdc207714270b77/Lib/threading.py#L933-L935.

That lock is removed when the thread is "join"ed: 
https://github.com/python/cpython/blob/8b795ab5541d8a4e69be4137dfdc207714270b77/Lib/threading.py#L988-L990

So the simple solution is to make sure that you always join your threads (which 
I'd expect normal code to do for non-daemon threads anyway), or to make your 
threads daemon threads.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-02 Thread Igor Mandrichenko


New submission from Igor Mandrichenko :

There is an apparent memory leak in threading. It looks like memory grows when 
I create, run and destroy threads. The memory keeps adding at the rate of about 
100 bytes per thread.

I am attaching the code, which works for Linux. getMemory() function is 
Linux-specific, it gets current process memory utilization

--
components: Extension Modules
files: memleak.py
messages: 387948
nosy: igorvm
priority: normal
severity: normal
status: open
title: memory leak in threading ?
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49846/memleak.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-02 Thread Igor Mandrichenko


Change by Igor Mandrichenko :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43375] memory leak in threading ?

2021-03-02 Thread Igor Mandrichenko


Igor Mandrichenko  added the comment:

You are right. When I add join(), the memory does not grow any more.
Thanks !

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com