I started using MATLink and find it extremely useful (Windows 7, MATLAB R2016a). I now run Simulink models from Mathematica. I use Mathematica's Table to vary parameters and run simulations hundred of times.
The issue I have is that under heavy use, I frequently (not always) get this error:
MATLink has lost connection to the MATLAB engine; please restart MATLink to create a new connection. If this was a crash, then please try to reproduce it and open a new issue, making sure to provide all the details necessary to reproduce it.
After this, MATLAB still runs, but a process named mengine(255t9_shm) is unresponsive.
So my questions are:
- Is there a log or any way to help debug this?
- If this is a known issue, are there any recommendation to help reduce the probability of happening?
This additional info may help:
Description: A problem caused this program to stop interacting with Windows. Problem signature: Problem Event Name: AppHangB1 Application Name: mengine.exe Application Version: 0.0.0.0 Application Timestamp: 53ed4362 Hang Signature: d307 Hang Type: 0 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Hang Signature 1: d307cfb0fa1a7b068e527ae7638aaff9 Additional Hang Signature 2: 9d83 Additional Hang Signature 3: 9d83477c1d6f0fd43ba72dee10f37eb2 Additional Hang Signature 4: d307 Additional Hang Signature 5: d307cfb0fa1a7b068e527ae7638aaff9 Additional Hang Signature 6: 9d83 Additional Hang Signature 7: 9d83477c1d6f0fd43ba72dee10f37eb2 UPDATE: When connecting directly to MATLAB using enableservice('AutomationServer', true), and after couple hundred simulations MATLAB crashed:
Problem signature: Problem Event Name: APPCRASH Application Name: MATLAB.exe Application Version: 9.0.0.0 Application Timestamp: 5681c359 Fault Module Name: nvoglv64.DLL Fault Module Version: 9.18.13.2063 Fault Module Timestamp: 51dd4126 Exception Code: c0000005 Exception Offset: 00000000009e7448 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: b136 Additional Information 2: b136ebd8fc0cb0735d6c2535ce1a5373 Additional Information 3: e255 Additional Information 4: e255aab41a076985e53d70c88b0b9f6d This makes me thing that the problem may be with MATLAB and not with MATLink.
$UserBaseDirectory/ApplicationData/MATLink, but it is unlikely to be helpful in this case. Can you at least show the basic calling syntax you are using, so we can have some idea about what data structures are being transferred? You could also try this method to be able to keep interacting with MATLAB directly, and check what it is doing: mathematica.stackexchange.com/a/69937/12 $\endgroup$menginehangs (?). The problem is that the only way we can fix this is if we can reproduce the problem. $\endgroup$