Garbage collection in Tensorflow 1.14
In Tensorflow 1.*, myvar will not be collected even if you lost track of the variable pointing to it, till the Python process terminates. 

In Tensorfow 2.* it will be collected by the garbage collector. 

For details, see the blog by Tensorflow, under the "No more globals" section.