Question d’entretien chez Goldman Sachs

1 Do you know how to implement garbage cleaning in Java?

Réponse à la question d'entretien

Utilisateur anonyme

8 janv. 2011

You cannot implement garbage collecting in Java. If you want garbage collection to occur, you have to use System.gc(); System.gc() is not a force call to the JVM, it merely is a suggestion to the JVM to do garbage collection. It is up to the JVM when garbage collection will occur. A simplified view of how garbage collection is implemented in the JVM: http://chaoticjava.com/posts/how-does-garbage-collection-work/