memory footprint of system objects
    8 views (last 30 days)
  
       Show older comments
    
    Mattias Arlbrant
      
 on 13 Dec 2024
  
    
    
    
    
    Commented: Mattias Arlbrant
      
 on 16 Dec 2024
            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?
0 Comments
Accepted Answer
  jibrahim
    
 on 13 Dec 2024
        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.
More Answers (0)
See Also
Categories
				Find more on Spectral Analysis 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!
