[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-29 Thread eleven xiang
eleven xiang added the comment: I am not asking for your help to use python. What I post here is to want to report a potential issue about multiprocessing module. This issue is the default start method fork will not free the object, but other methods works normally. When I change to use

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
Change by eleven xiang : -- resolution: not a bug -> ___ Python tracker <https://bugs.python.org/issue45308> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
eleven xiang added the comment: Below is the log: // parent process call and increase it from 10 to 11. process 71481, this = 0x7f4f271b5054, m_val = 10, A constructor called!!! process 71481, this = 0x7f4f271b5054, m_val = 11, INC called!!! // child process inherit with 11, and then also

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
eleven xiang added the comment: I still have some questions about is, so re-open it. You mean it is the fork principle, but if change the script to use os.fork(), the child process will inherit from parent, and also free it. You could refer below change: from ctypes import cdll import

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
eleven xiang added the comment: update test platform Ubuntu 16.04 -- ___ Python tracker <https://bugs.python.org/issue45308> ___ ___ Python-bugs-list mailin

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
eleven xiang added the comment: you could use below command to build test.so from test1.cpp g++ test1.cpp -shared -fPIC --std=c++11 -o test.so -- ___ Python tracker <https://bugs.python.org/issue45

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
Change by eleven xiang : Added file: https://bugs.python.org/file50308/test1.cpp ___ Python tracker <https://bugs.python.org/issue45308> ___ ___ Python-bugs-list mailin

[issue45308] multiprocessing default fork child process will not free object, which is inherited from parent process

2021-09-28 Thread eleven xiang
New submission from eleven xiang : Hi, Here I did an experiment, and detail as below 1. There is library, which has global object and has its class method 2. Use multiprocessing module to fork the child process, parent process call the global object's method first, and then child pr