tries to perform a `` full '' garbage collection cycle including processing of weak references and invocation of finalize methods and waits for it to complete . ensures that at least one weak reference has been cleared and one finalize method has been run before thismethod returns . this method may be useful when testing the garbage collection mechanism itself , or inhibiting a spontaneous gc initiation in subsequent code . in contrast , a plain call to java.lang.system #gc does not ensure finalizationprocessing and may run concurrently , for example , if the jvm flag - xx : + explicitgcinvokesconcurrent is used.whenever possible , it is preferable to test directly for some observable change resulting from gc , as with #awaitclear . because there are no guarantees for the order of gc finalization processing , there may still be some unfinished work for the gc to do after this method returns . this method does not create any memory pressure as would be required to cause soft references to be processed . concode_field_sep PlaceHolder placeHolder concode_field_sep RuntimeException formatRuntimeException concode_elem_sep void await concode_elem_sep void createUnreachableLatchFinalizer concode_elem_sep long timeoutSeconds concode_elem_sep boolean isDone concode_elem_sep void awaitDone concode_elem_sep void awaitDone concode_elem_sep void awaitClear