How to add Garbage collector to clear Object Variables post Pkg execution

Hi,
Can anyone please help me on how to use ipdispenser using Script Task to kill the Variables once the usage is done. I have a package where we pass variables from Parent to Child and Vice Versa, at the end of the instance I want to dispose the variables used here so that when a second instance starts it works properly without impacting the memory. Can you please guide me on the steps to use this and how to configure it in SSIS flow.