Seetharaman Venkatesan wrote:I have partial answers for 2 and 3 but I would be grateful if some helps me by explaining them in detail.
Joanne
Adam Michalik wrote:I think that explicit object removal using delete could be faster, because you would directly point at the object to be deleted
I have been a C++ guy for quite some time (read new to Java) , and new/delete give more control to the programmer/application to allocate and de-allocate memory. And by the end of de-allocation you know, memory has been released and is available for sure (Predictable).
But that is not the case with GC. Even if you envoke System.gc(), you are not assured immediate results. And GC's behavior is unpredictable. There are possibilities of 'pausing', which could affect the performance of the application.
So I always feel that new/delete is faster than GC.
But what about scenarios where GC being faster than new/delete?
Looking forwards for some answers..
Don't get me started about those stupid light bulbs. |