[Bug] sub processes are kept running even after separating is done and are re-created even after kill
- Dominant language
- Python
- Stars
- 28.4k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
- [X] I didn't find a similar issue already open.
- [X] I read the documentation (README AND Wiki)
- [X] I have installed FFMpeg
- [X] My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)
## Description
I am trying to use spleeter for vocal extraction in a song, with the following code. I found it is trying to spawn several sub processes for its work (and it works fine to separate what I wanted), but even after the separation is done, these sub processes are still kept running.
```
separator = Separator('spleeter:2stems')
separator.separate_to_file(filepath, self.filedirectory)
separator = None
```
I even tried to kill these sub processes with below code, it seems the sub processes are being re-created after being killed.
```
current_process = psutil.Process()
children = current_process.children(recursive=True)
for child in children:
print('Child pid is {}'.format(child.pid))
os.kill(child.pid, signal.SIGTERM)
```
See below for the debug screenshot before kill (after it was run).
See below for the debug screenshot after kill.
Each sub processes takes around 170MB of memory. See below for the memory usage even after kill (these sub processes are not created elsewhere).
## Step to reproduce
1. Installed using `pip install spleeter`
2. Run as standalone or using VSC to debug
## Output
Memory is kept high even after use and sub processes are kept running, even after killing they will be re-created.
## Environment
| | |
| ----------------- | ------------------------------- |
| OS | Windows |
| Installation type | pip |
| RAM available | 8GB |
| Hardware spec | CPU |
## Additional context
Contributor guide
Assessment
This issue has not been assessed yet.


