Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread TDataSet: empty to release memory?
Tue, Apr 20 2021 9:45 AMPermanent Link

Sergei Safar

Hi All

suppose you have a Dataset on a Form/Dialog and executed Database.LoadRows(Dataset) loading many records.

Questions:

1 - is it necessary to empty the dataset before destroing the form/dialog to release memory or just destroying the form/dialog is enough?

2 - Is it necessary to close the Dataset before destroying the Form/Dialog or this?

Thank you.

Regards,

Sergei Safar
Thu, Apr 22 2021 8:33 AMPermanent Link

Raul

Team Elevate Team Elevate

On 4/20/2021 9:45 AM, Sergei Safar wrote:
>
> suppose you have a Dataset on a Form/Dialog and executed Database.LoadRows(Dataset) loading many records.
>
> Questions:
>
> 1 - is it necessary to empty the dataset before destroing the form/dialog to release memory or just destroying the form/dialog is enough?
>

Destroying form/dialog is enough since it's the parent of the dataset
and will release it as well.

> 2 - Is it necessary to close the Dataset before destroying the Form/Dialog or this?

Not required as it should do that automatically.


If you do have tons of data in there then it would be part of browser
overall memory usage so if you really wanted you could empty/close it
once you're done with it as a good practice. Then again with the amount
of RAM modern browsers consume themselves it might not matter anyways.

Raul
Thu, Apr 22 2021 7:59 PMPermanent Link

Sergei Safar

Raul wrote:

On 4/20/2021 9:45 AM, Sergei Safar wrote:
>
> suppose you have a Dataset on a Form/Dialog and executed Database.LoadRows(Dataset) loading many records.
>
> Questions:
>
> 1 - is it necessary to empty the dataset before destroing the form/dialog to release memory or just destroying the form/dialog is enough?
>

Destroying form/dialog is enough since it's the parent of the dataset
and will release it as well.

> 2 - Is it necessary to close the Dataset before destroying the Form/Dialog or this?

Not required as it should do that automatically.


If you do have tons of data in there then it would be part of browser
overall memory usage so if you really wanted you could empty/close it
once you're done with it as a good practice. Then again with the amount
of RAM modern browsers consume themselves it might not matter anyways.

Raul


Hi Raul,

thank you for the explanation.

Best regards,

Sergei Safar
Image