Hi all,
I don't know if I have found the mistake/solved the problem.
I am solving in an S-Function PDEs that are converted into ODEs. Hence, I have a longer state vector ("Grid Points") and its length should be adjusted through the S-Function parameter ("Number of Points"). I have used 'malloc' and 'free' functions to adjust them. I additionally have written wrapper functions, to be able to use Simulink in Accelerator Mode. So far, the 'malloc' and 'free' functions were implemented for auxiliary variables (not the state vector itself) in both, the output and derivative function, allocating and freeing memory in each time step. Now, I have declared those auxiliary variables global in the wrapper file, so that they only have to be adjusted during start of simulation. I know that global variables shouldn't be the first choice, and I would prefer work-vectors instead. I however, have one multi-dmiensional array that is being adjusted with malloc as well.
Since then, I haven't encountered any problem and also the memory of my PC is not steadily growing any more (have nonetheless always used 'free' functions).
I think/hope, this should resolve my problem.
As a last question, I would like to ask whether multidimensional work vectors in Simulink are possible (maybe I should start a new thread for this question)?
And finally, I would like to thank everybody for all the hints.
Cheers,
MIchael