I encounter a memory leak warning when i simulate my simulink model from a GA optimization code which iteratively simulate my model
Show older comments
Here's the warning message :
Warning: Internal warning: A JITEngine loaded for block simulation cannot be freed due to non-zero reference count. It is usually caused by
unpaired calls to a block's "setupRuntimeResources" and "cleanupRuntimeResources" methods.
> In optimising2_3 (line 209)
In Run_fuzzyGA_Tunning_R1 (line 79)
Answers (1)
Umar
on 8 Jul 2024
0 votes
Hi Joel,
In response to this issue, it is crucial to ensure proper pairing of calls to the "setupRuntimeResources" and "cleanupRuntimeResources" methods for the blocks in your Simulink model. This discrepancy can lead to memory leaks due to the JITEngine not being freed correctly. To address this warning and resolve the memory leak issue, you should review the implementation of your GA optimization code, specifically focusing on how the "setupRuntimeResources" and "cleanupRuntimeResources" methods are being called for each block during iterative simulations. Make sure that these calls are appropriately paired to avoid any reference count discrepancies that could lead to memory leaks.
Additionally, consider checking the specific blocks in your Simulink model where this warning is occurring (as indicated by line 209 in 'optimising2_3' and line 79 in 'Run_fuzzyGA_Tunning_R1'). Ensure that the block configurations and method calls are correctly managed within your optimization code to prevent any further memory leak issues.
By addressing these key points and ensuring proper handling of block resources within your Simulink model and GA optimization code, you should be able to mitigate the memory leak warning and optimize the simulation process effectively. Remember to test your revised implementation thoroughly to confirm that the warning no longer persists.
Please bear in mind that resolving memory leak warnings in Simulink simulations requires careful management of block resources and method calls within the optimization code. By addressing these issues systematically, you can enhance the efficiency and reliability of your simulation process while avoiding potential memory-related complications.
Categories
Find more on Manual Performance Optimization 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!