KT.EXPLICIT_GARBAGE_COLLECTION_CALL

Explicitly trigger the Garbage Collector

Reports all calls to explicitly trigger the Garbage Collector. Code should work independently of the garbage collector and should not require the GC to be triggered in certain points in time.

Noncompliant Code

Copy
System.gc()
Runtime.getRuntime().gc()
System.runFinalization()

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html