I think both do the same thing.But when we call gc , then also it is not guaranted that this would really remove the garbage objects from the heap releasing memory.
Originally posted by Bauke Scholtz: From the System.class Personally I use System.gc(), because this is less code typing
Personally, I never use either -- and neither should you. It's extraordinarily rare that calling one of these methods actually improves an application, and often it has the reverse effect.