Zombie MATLAB Processes Remain After parpool/parfor and delete(gcp('nocreate'))

7 views (last 30 days)
I'm encountering a persistent issue with MATLAB's Parallel Computing Toolbox when using "parpool('Processes', 20)" or "parpool(20)" and later "parfor" computing.
I launch a pool using "parpool('Processes', 20)" or "parpool(20)" and then run a parfor loop. During execution, CPU and memory usage behave normally.
After the computation ends as expectation, I call "delete(gcp('nocreate'))" to close the parallel pool or time ends MATLAB shuts it down. However, CPU usage spikes to 100%, and dozens of MATLAB background processes remain visible in Task Manager, each using ~1–2% CPU. Even after closing the main MATLAB GUI, the processes continue running.
The only thing i can do is restart the computer.
  3 Comments
Raymond Norris
Raymond Norris on 7 Jul 2025
@Sean I'm gathering these dozens of MATLAB processes weren't running before you started the pool? You're running R2025a, have you seen this with any older versions of MATLAB?
What does the following return?
feature numcores
After you delete the pool, what does the following return?
isempty(gcp("nocreate"))

Sign in to comment.

Accepted Answer

Edric Ellis
Edric Ellis on 8 Jul 2025
This is not expected. Please contact MathWorks support who can help get to the bottom of this problem. When you contact them, it would be helpful to include the following pieces of information
  • MATLAB version, computer OS
  • What are you running on the workers? Numerics? Graphics? Simulink?
  • Can you reproduce the problem using delete(parpool("Processes")) ?
As a temporary workaround, here are a couple of things you can try, either in MATLAB, or at a Windows Command Prompt. Firstly, list all worker MATLAB processes
% List worker processes
!tasklist /fi "IMAGENAME eq MATLAB.exe" /fi "WINDOWTITLE ne MATLAB*" /v
Rather than rebooting your system, you can try cautiously the following command, which will forcibly terminate the processes listed above:
% DANGER DANGER! THIS COMMAND KILLS PROCESSES!
!taskkill /fi "IMAGENAME eq MATLAB.exe" /fi "WINDOWTITLE ne MATLAB*"

More Answers (0)

Categories

Find more on Parallel Computing Fundamentals in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!