- the profiler will display a summary of the runtime behavior and performance metrics.
- Analyze the profiler results, focusing on areas such as function execution time, memory usage, and function call hierarchy.
- Look for any performance bottlenecks, memory-intensive operations, or functions that consume excessive memory.
Advice on Heisenbug causing crash in code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi
I keep on getting a matlab crash when running a matlab script I have that routes simulink models using JSON data.
It's an odd bug as when i attempt to run the script in debug mode slowly the crash doesn't occur.
This suggests to me there is some form a memory management problem. Does anyone have any advice?
Should I institude delays in my code with a timer? Are there methods that i should be using to control these sorts of errors?
Thanks
0 comentarios
Respuestas (1)
Shivam Lahoti
el 20 de Oct. de 2023
Hi Paul,
From what I can understand, you are getting a MATLAB crash while running a script that routes Simulink models using JSON data. The script runs successfully when run in debug mode.
The crash could be due to multiple reasons and as you pointed out it might be a memory management problem. MATLAB has a tool named MATLAB Profiler, which creates reports of the runtime of MATLAB code, broken down by individual function calls.
The profiler is primarily designed to analyze the runtime behavior of your code, identify performance bottlenecks, and suggest areas for optimization. However, if the crash is related to excessive memory usage or inefficient code that leads to out-of-memory errors, the profiler can help you identify memory-intensive operations or memory leaks that may contribute to the crash.
Have a look at the following documentation to understand how to use the MATLAB profiler.
This might not directly tell the cause of the crash but might point to some sections that might be the cause of the crash, later the code could be modified and check for the compatibility report to debug the section.
I hope this helps.
Regards,
Shivam Lahoti.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!