Matlab's C API interface degrades over time

1 回表示 (過去 30 日間)
Zohar
Zohar 2023 年 2 月 28 日
編集済み: Zohar 2023 年 2 月 28 日
I've been having this issue (for years!), matlab slowing down gradually when running many iterations that use the C interface, which I've been handling by restarting matlab every X iterations:
Now, I'm having a similar issue, but restarting matlab doesn't help and isn't needed. I need to restart my own c++ app that uses matlab's C interface.
My estimate is that matlab's engine dll that my app is using degrades and doesn't reset between new engine connections.
Maybe somehow reloading the engine dlls may be enough?
  2 件のコメント
Jan
Jan 2023 年 2 月 28 日
I did not observe such a degradation. Of course, the C inrterface is not getting tired.
Can you provide a minimal working example to clarify, what the actual problem is? I'm even not sure what "degrading" means in detail. Do you mean leaking memory or creating zombie threads?
Zohar
Zohar 2023 年 2 月 28 日
編集済み: Zohar 2023 年 2 月 28 日
Degrading ("matlab slowing down gradually") means that in the first 20 iterations, an iteration (that makes a few engine calls) takes 12sec to run. Over time, the running time increases, e.g., 1min per iteration after 2000 iterations.
From a first look, the executed matlab script itself takes the same time to run. By either calling the script or exchanging variables with the engine, it gets slower.
A minimal example would be tricky, but I'll give it some thought. Maybe I should start with the examples in the links on my linked thread.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by