In Java, there is a method called
System.gc(), which calls the garbage collector (or rather, "suggests" to the JVM to run the GC).
Are there valid reasons to call this method? I'm thinking that it would be evident of bad software design.
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
In general, there isn't a good reason to call System.gc(). Especially since the system might ignore it. But here are some plausible reasons.