Then
In a class, a local variable will be cleaned when?
Do you mean in a method? No need unless he has serious problems.
In a global variable, if you get null in it, knowing that it will be no longer useful, will it help with application performance?
Yes, help, but if possible, change this pattern so you do not have to do this
In class variables, give null whenever it's no longer in use, can it improve application performance?
Maybe, but it should also change the pattern.
On android, is the same practice synonymous with performance? In doing so, would not I be "saving" unused memory?
Being static has nothing to do with performance, but not directly. It may even have a tiny gain in call, but it's not relevant.
Static methods do not store unused memory. Static variables can help do this eventually
Explanations
Overall the advantage is zero, at least if the code is well done.
In fact undoing a variable can cause a reference to cease to exist and an object that is heap can be collected by GC at any time by releasing memory.
This is not guaranteed because the object may have other references that still hold it alive in memory. But overriding the variable is already doing its part.
Bypassing a local variable in a method does not make sense because all of them are automatically undone at the end of the method. It would make sense if the method hangs in a thread for some reason and for a bad reason holds back references it should not. This is actually a programming error, fix the bug instead of doing a trick trying to get rid of the reference. It does not matter whether the method is static or not, they themselves are not problematic.
In a class a member can hold a reference when in fact it should not. Actually in instances it is less common because at any given moment the instance will die and all its variables are automatically overridden at this point. What can occur is an object surviving more than expected and this is probably a programming error as well and should be solved.
But if the object lasts too long then it should rethink the structure of the object. Maybe it has a variable holding a reference to another object that should not be there.
This can occur with static members of a class that have all the durability of the application. If a static variable should have its value aborted, it should rethink whether the variable should be static or even exist.
Static members may be global status problem , but they can be useful if you know what you are making. Almost always that you need to cancel it, you do not know what you're doing. The fact that the static variable stays there all the time is not a problem because it has a small value every time, or is a value type, or is a reference. Her problem may be competition or holding a reference for longer than it should. But there are cases for its use. Whoever understands the workings of things and does not follow "good practices" blindly knows this.
Note that overriding a variable is different from changing its value. When we put another reference to a variable the object that was previously pointed by this variable loses this point and possibly can be collected.
There are even a few rare cases where voiding the variable can be useful, but it's rare, it almost always has a better way of doing this and should fix the right problem.
Even if you override a variable and the referenced object has no other references, there is no guarantee that the GC will collect the object at some point. Not that the GC is unpredictable, you just do not know when it will run. Only time is not deterministic and the application may terminate before a collection occurs. But if a collection is fired and the object has no references it will be collected for sure, it is not a crazy thing that no one knows whether it will occur or not.
He said good practice. I wring my nose. In general the person is reproducing what he has read without understanding it or is selling an idea without wanting to instruct the reader.
The text quoted has several errors, some serious and is the opposite of reality, the bold quote in the question for example, would not trust it. It occurs in most of the content on the internet.