How to avoid memory leaks when function inside parfor generates warning?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello!
I use matlab R2015b for Win Server 2012 OS with local parpool. I have memory leaks on local workers when function inside parfor-loop generate warning. Also memory is not released after parfor-loop ends. Example:
x = rand(78, 1);
for j = 1:100
parfor i = 1:1000
[~, z] = kpsstest(x);
end
end
[~, z] = kpsstest(x) generates warning:
Warning: Test statistic #1 below tabulated critical values:
maximum p-value = 0.100 reported.
> In kpsstest>getStat (line 632)
In kpsstest (line 291)
Memory leaks on workers even when i use constructions:
warning('off', 'econ:kpsstest:StatTooSmall');
pctRunOnAll warning('off', 'econ:kpsstest:StatTooSmall')
Memory on start workers:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162410/image.png)
Memory on after executing code:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162411/image.png)
How to avoid memory leaks when function inside parfor generates warning?
Thank you.
댓글 수: 0
채택된 답변
Edric Ellis
2017년 3월 31일
This problem is the subject of this bug report. If you are able to upgrade to R2017a, that's the simplest workaround.
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!