Why do I receive a warning regarding exhausted change notification handles when I open MATLAB?

24 views (last 30 days)
When I open MATLAB, I see a warning similar to the following:
Warning: Could not get change notification handle for remote <directory_name>. Windows has exhausted its pool of handles for this file server. Cannot determine whether this server supports directory timestamp updates. Type 'help change_notification' for more info

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Sep 2019
Edited: MathWorks Support Team on 23 Sep 2019
MATLAB uses a Microsoft feature called Change Notification Handles (CNHs) to track if a file has been updated in a directory which has been added to the MATLAB path or is the current directory. These CNHs are shared between all of the programs on a machine. When connecting to a server, Windows will use the lowest setting (either the client or the server) to determine how many CNHs may be created between the server and the client machine.
This warning message indicates that Windows has exhausted its supply of change notification handles. This could mean new files in this directory are not detected by MATLAB, or changes to existing files are not detected, if you are editing the files outside of MATLAB. There are four possible solutions to this issue:
1. The most robust solution is to prevent exhausting the supply of change notification handles by increasing the number of available CNHs on both the client and server side (by default the limit is 50). On Windows, CNHs are a type of Current Command. To increase the limit of Current Commands on both the client machine and the server, see this Microsoft knowledge base web page:
For Windows:
For more information about tuning these parameters:
To make this same change for a non-Microsoft server, consult the documentation and look for a setting that has the same effect as the MaxMpxCt setting which is described on the Microsoft knowledge base article. (For instance, Netapp uses cifs.max_mpx.)
Any modifications for the server to support more handles would be server-specific.
2. Keep your current Windows settings and reduce the number of CNHs you are using by removing extraneous user added paths from your MATLAB path. Each path that you remove will release a CNH back to the OS for use.
Note that the directories that are part of the MATLAB default path and exist under the MATLABROOT directory do not receive a CNH initially because it is assumed that the files in these directories are static. Making any directory your current directory will cause MATLAB to ask for a CNH for that directory.
3. Keep your current Windows settings and use the SYSTEM_DEPENDENT command to change how MATLAB interacts with CNHs. You may request that MATLAB not use CNHs, or you may suppress any warnings about CNHs. You can specify what policy MATLAB should use after CNH exhaustion using the commands
>> system_dependent('RemotePathPolicy', <policy>);
>> system_dependent('RemoteCWDPolicy', <policy>);
For more information about how MATLAB uses SYSTEM_DEPENDENT to change MATLAB's interactions with CNHs see the documentation linked below:
4. If for example, you are editing files outside of MATLAB, you can force MATLAB to detect changes to the file by executing any of the following within MATLAB:
>> clear functionname %functionname is the name of the function that changed
>> clear functions %clear all functions
>> clear all %also clears all variables
If these solutions do not help resolve the issue, please refer to your local IT department for assistance.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!