Sunday, March 7, 2010

Bad optimization

You can prevent third-party libraries from doing this by including the "-XX:-DisableExplicitGC" option at the command line (see http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for details).
public static void resetList()
{
    this.list = new ArrayList()
    System.gc(); // unnecessary at best!
}

No comments:

Post a Comment