Matlab 2025b become unresponsive after running long iterations
16 views (last 30 days)
Show older comments
The thing seems to get stuck after loading a lot of files.
Despite those files are not kept in the memory.
e.g.,
for i = 1 : 10000
filename = xxxx_i % different file each iteration
data = load(filename);
% then do something with data, and data is updated every iteration
end
and MATLAB becomes unresponsive after running the said code. The behavior is kind of reproducable in different scripts loading different files for different purposes. The common ground is they are all loading a lot of files, and Matlab gets stuck afterwards. The memoery useage is normal.
Appears to be a new issue starting from 2025b, 2025a doesn`t have this behavior.
2 Comments
Steven Lord
8 minutes ago
Without more details about what is happening during the "% then do something with data, and data is updated every iteration" step, it's likely going to be difficult if not impossible to offer any concrete suggestions.
dpb
about 3 hours ago
Edited: dpb
30 minutes ago
Can you reproduce the symptoms with only
for i = 1 : 10000
filename = xxxx_i % different file each iteration
data = load(filename);
end
this part of the process? If so, could be indicative of not freeing up system file handles and running out of system resources.
Another possibility is that while overall memory use isn't excessive, the constant redefinition of the data variable causes memory segmentation and the system can't find a contiguous memory space of sufficient size.
Do symptoms change if you do forcibly
clear data
at the end of the loop before starting the next iteration?
Answers (0)
See Also
Categories
Find more on Programming Utilities in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!