MATLAB Engine API for Python memory overflow
조회 수: 9 (최근 30일)
이전 댓글 표시
Python calls matlab.double, which is a very simple line of code, but it can be seen from the task manager that the memory has been soaring.I'm using a for loop to call this code constantly, and I'm also using some clear and other functions to clear the memory, but none of them have any effect unless the instance is restarted
import matlab.engine
test_matlab_engine = matlab.engine.start_matlab('-nodisplay -singleCompThread -nojvm')
def a():
data_array = []
for i in range(10000):
data_array.append(i)
a= matlab.double(data_array)
if __name__ == '__main__':
while True:
a()
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1790885/image.png)
댓글 수: 2
Aimee Nogoy
2024년 10월 16일
Facing the same issue and still trying to debug. Using Python 3.10 and Matlab 2023b
답변 (1개)
Jayanti
2024년 10월 22일
I found a bug report similar to the issue you are facing. You can look for the workaround in the below link:
참고 항목
카테고리
Help Center 및 File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!