Dataset housekeeping

What is the property way to free up the memory created by a dataset? We may have hundreds created during a session with many users. How is the dataset memory being used released?

Thanks

Gary

As far as I know you can set it to null.
Java will garbage collect it automatically or maybe Servoy initiates a garbage collect.

The variable that references the in-mem databases isn’t the concern. The concern is the hundreds or thousands of databases created on the server each time createDataSource() is called. How are those objects destroyed and what control does the developer have in managing the memory they are eating up on the server.

Gary

Gary,

You can call dataset.removeRow(-1), it will delete all data in the data set and free all memory except for a small record structure overhead.
We have to keep that because we never know if the user will navigate (using history for instance) back to the form or if some foundset is still based on this in-memory set and this could result in fatal internal errors.

If you re-use the same name for your data set,the same record structure will be reused, note that this only works if the set of columns is the same.

You could run a small memory test yourself, just create a data source from a data set and delete all data in a loop to see what memory usage effect is.

Rob

Thanks for that information Rob, we 'll do some testing and see what kind of memory hits the server takes having a large number of record structures in place at one time.

It is very good information you have given us to work with and we appreciate the tips.

Gary