I played with it a bit. I tried tracking the memory allocations using 'profile -memory on' and 'memory'. Unfortunately, the memory management in matlab is a fickle thing:
- When an array is allocated, some of the memory can be reserved.
- When you fill an array, allocation may occur.
- There's the garbage collection who's reponsible to free the memory, and it's unpredicatable.
Pardiso had nothing to do with the leak, and what I did seems fine. Pure luck led me to my logger. Through a socket, I send messages to a local app (since I'm calling matlab from cpp, and I want to see output). I used tcpip for that. I didn't see anywhere mentioned that delete should be called in the end:
Also, adding delete, didn't help.
Now, I'm using instead tcpclient, and for now, the leak seems to be resolved.
Best Answer