You don't. The memory is released back to the system, but it isn't made available to the system for recycling until it is garbage collected - and that only normally happens when your app requests a chunk of memory that can't be allocated - then the Garbage COllector is kicked into action and starts freeing up unused memory (and moving stuff about if it has to).
This gets quite complicated:
Fundamentals of garbage collection | Microsoft Docs[
^] but the basic rule is: don't worry about it, the system is better at this stuff than you are! :laugh:
If you really need to release resources though, you should be implementing a
Visual Basic Destructor - Tutlane[
^] rather than trying to manually do this in the FormClosing event - if nothing else, not all forms are unused once they are closed: think about a FileOpenDialog where you access the file name and path in your code only after the form is closed!