memory footprint of system objects

2 ビュー (過去 30 日間)
Mattias Arlbrant
Mattias Arlbrant 2024 年 12 月 13 日
コメント済み: Mattias Arlbrant 2024 年 12 月 16 日
Hi
I am creating audio processors using matlab and code generation. I would like to estimate the memory usage of my audio processor objects before running code generation. To do this I loop over all members and use whos. This works fine for arrays, scalar values etc. But some members are system objects and I am not sure how to get the size of them. For example, whos gives 8 bytes for a dsp.VariableIntegerDelay('MaximumDelay',256); Is this because the size is not known yet, since the number of channels have not been provided?

採用された回答

jibrahim
jibrahim 2024 年 12 月 13 日
Hi Mattias,
When you execute 'whos' on a system Object variable, the size you see is just the size of the variable pointing to the handle object. The size for this object will always be 8 bytes regadless of how many channels you use. the internal memory used by the object will not be reflected in the answer of 'whos'.
There is generally no good way to accurately estimate internal memory usage of system objects. The ref pages of the system objects will usually have descriptions of the algorithm where state size will be mentioned.
The "memory" function may be used for a rough estimate of how much memory your simulation is consuming. for example, you can execute "memory" before and after you execute your simulation, but again, this is just a rough estimate.
  1 件のコメント
Mattias Arlbrant
Mattias Arlbrant 2024 年 12 月 16 日
Hi, Thanks for the explanation!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Analysis についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by