Here's what I have
public void someMethod() {
MyObject myObject = new MyObject();
.. some more initialization code..
myObject = methodThatRetunsMyObject();
myObject.doSomething();
}
Question: Will the orphaned object creation lead to significant performance issues?
The goal is to achieve maximum transactions per second, hence my assumption is, orphaned objects would lead to GC runs which could affect throughput.