… That article is from 2004 and talks about Java 1.4.1… jME 3 uses 1.6 (I could be wrong about that version though as I might be a version or 2 below what is the default).
Plus… Again… Your article goes against what you’re suggesting.
A third category where developers often mistakenly think they are helping the garbage collector is the use of System.gc(), which triggers a garbage collection (actually, it merely suggests that this might be a good time for a garbage collection). Unfortunately, System.gc() triggers a full collection, which includes tracing all live objects in the heap and sweeping and compacting the old generation. This can be a lot of work. In general, it is better to let the system decide when it needs to collect the heap, and whether or not to do a full collection.
You are just changing the address of a reference you are not creating any new variable.
Makes literally 0 sense. Sometimes it does, this time it doesn’t. At all.
Also you are talking about micro optimization when you’ve built your for in the worst possible way. You need at least 9 000 micro optimization to break even.
I mean in the case with android, java is just a language which doesn’t work on JVM, so many things of how java works aren’t related to java on android.
Uses java → worries about variables delcaration.
This is not even a micro optimization, this is ocd
If you are for real, you should rethink about your priorities and figure out that saving 0.0000001 ns is not worth the effort expecially when you make shitty code everywhere else.
You made your loop successively worse. It’s bad advice. There is no good reason to do it and many bad reasons to do it. You don’t have enough experience to understand this.
Go ahead and put together a microbench mark showing your case… we will show you why it’s wrong.