I am experiencing physical memory issues when running the FAST_SFunc inside my Simulink model. As I step through different wind files, my physical memory usage continues to grow until Matlab ceases. To sidestep this issue, I am currently using a Perl script to periodically restart Matlab so that all memory is released back to the system.
From troubleshooting, I am confident that it isn’t Matlab arrays growing in size. The ‘clear all’ command does practically nothing in terms of releasing memory. I feel the issue is either some memory leak occurring within the SFunction or my Simulink model has some inefficiencies that are causing this problem or it is some inherent issue with Matlab-Simulink.
Is there a better solution than my current method?
We are aware of this issue, which is caused by a memory leak in the AeroDyn module that is compiled with FAST to form the S-Function. AeroDyn allocates memory for the wind data and never explicitly releases it, assuming that when the “program” closes, that space in memory will automatically be released (this is what happens when the FAST.exe is run via the command prompt). However, when compiled as an S-Function for Matlab, the “program” is Matlab. Each time you run the model, it needs more memory, and it eventually runs out of space. With smaller wind files, it’s not as noticeable. We have a fix for this, which we plan to issue in our next release of FAST and AeroDyn, which we are on track to deliver in January, 2010. Without the fix, the only solution is to re-start Matlab. “Clear” doesn’t release the allocated memory in the S-Function.
What is the status of the new FAST/Aerodyn release that resolves the memory issue problem in MATLAB? Thanks.
Due to reasons beyond our control, the January deadline has slipped. Our plan now is to release updates to FAST, AeroDyn, ADAMS2AD at the end of March.