Hi all!
I am working at an event simulation covering the evaluation of a self-organized TDMA network. With the time my code base got really big. After I started to run the simulation with a lot of actors (800 and more) the RAM consumption went up, though I had been very careful to free all memory allocated.
In a news group I read about heap fragmentation and I think that could be what my program is suffering from. I am only creating small TObject descendants, but I have a lot of dynamic arrays containing quite big records of data which I often call SetLength() on (both increasing and decreasing the size).
So maybe the "big" records in the dynamic arrays "fight" with the small objects such that memory fragmentation occurs?
I have searched for a while on the net but could not find good methods to avoid this with Delphi. (One was to create factories for any kind of object, but since I think that the dynamic arrays are the real problem this is not really applicable.)
Has anyone had the same problem, and which solutions did you apply?
Thank you very much for suggestions!
Anne
I am working at an event simulation covering the evaluation of a self-organized TDMA network. With the time my code base got really big. After I started to run the simulation with a lot of actors (800 and more) the RAM consumption went up, though I had been very careful to free all memory allocated.
In a news group I read about heap fragmentation and I think that could be what my program is suffering from. I am only creating small TObject descendants, but I have a lot of dynamic arrays containing quite big records of data which I often call SetLength() on (both increasing and decreasing the size).
So maybe the "big" records in the dynamic arrays "fight" with the small objects such that memory fragmentation occurs?
I have searched for a while on the net but could not find good methods to avoid this with Delphi. (One was to create factories for any kind of object, but since I think that the dynamic arrays are the real problem this is not really applicable.)
Has anyone had the same problem, and which solutions did you apply?
Thank you very much for suggestions!
Anne