Memory problem

View: New views
1 Messages — Rating Filter:   Alert me  

Memory problem

by danielelinaro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everybody,
I've been using CVode for quite some time now and recently switched to version 2.6.0. Today I realised that  my code has a serious memory problem. What my code does is integrate a set of ODE's for a great number of times, each time changing the values of some parameters of the system. Therefore, I allocate memory for CVode only once and then call a bunch of time CVodeReInit to reset both the time and the initial conditions. The buffer where the solution of the integration is stored is allocated only once, and the function CVode is called many times because I need to have the solution at precise time instants. What I've noticed is that if I comment the line where CVode is called (and simply increment the time), the program uses a tiny amount of memory, whereas when CVode is called the amount of memory allocated grows quickly and eventually saturates the available RAM. I am quite confident that my code does not contain any memory leaks because after CVodeFree is called all the memory is released.

If it may be of any help, I can post snippets of my code.

Any help would be much appreciated.

Thanks,
Daniele