xxsimGetMemoryUsage - retrieve the memory usage of 20-sim and the available system memory. Syntax: retval = xxsimGetMemoryUsage() Inputs: takes no arguments. Outputs: retval = returns a structure object. Examples: xxsimGetMemoryUsage(); - retval now contains the actual 20-sim memory usage. - the output is returned in a structure array form. e.g retval.success : is 1 on a successful call. retval.USERObjects : returns the number of USER objects that are in use. retval.GDIObjects : returns the number of GDI objects that are in use. retval.WorkingSetMemory : returns the current memory usage in megabytes (MB). retval.PeakWorkingSetMemory : returns the peak memory usage in megabytes (MB). retval.AvailablePhysicalMemory : returns the available physical memory on the system. Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl November 2015
0001 function retval = xxsimGetMemoryUsage() 0002 % xxsimGetMemoryUsage - retrieve the memory usage of 20-sim and the available system memory. 0003 % 0004 % Syntax: 0005 % retval = xxsimGetMemoryUsage() 0006 % 0007 % Inputs: 0008 % takes no arguments. 0009 % 0010 % Outputs: 0011 % retval = returns a structure object. 0012 % 0013 % Examples: 0014 % xxsimGetMemoryUsage(); 0015 % 0016 % - retval now contains the actual 20-sim memory usage. 0017 % - the output is returned in a structure array form. 0018 % e.g 0019 % retval.success : is 1 on a successful call. 0020 % retval.USERObjects : returns the number of USER objects that are in use. 0021 % retval.GDIObjects : returns the number of GDI objects that are in use. 0022 % retval.WorkingSetMemory : returns the current memory usage in megabytes (MB). 0023 % retval.PeakWorkingSetMemory : returns the peak memory usage in megabytes (MB). 0024 % retval.AvailablePhysicalMemory : returns the available physical memory on the system. 0025 % 0026 % 0027 % Author: Controllab Products B.V. 0028 % email: info@controllab.nl 0029 % Website: http://www.controllab.nl 0030 % November 2015 0031 0032 %------------- BEGIN CODE -------------- 0033 0034 if(nargin>0) 0035 error('Too many input arguments: xxsimGetMemoryUsage does not expect any input arguments.'); 0036 end; 0037 0038 % and make the actual call to 20-sim 0039 reply = xrlinvoke('xxsim.util.getMemoryUsage'); 0040 0041 retval = reply; 0042 end 0043 %------------- END OF CODE --------------