title: How good a practice is this?
body: <p>Say I have a Java application which handles thousands of users. So for each user action a certain block of code will be executed repeatedly and I am creating millions of temporary objects. I write my method this way.</p>
  
  <pre><code>public void myMethod(ClassB a, ClassA b) {
      ClassC c = null;
      ClassD d = null;
  
      try {
          c = new ClassC();
          d = new ClassD();
  
          // Some code which uses a, b, c, d.
      } catch (Exception e) {
      } finally {
          a = null;
          b = null;
          if (c != null) {
              c = null;
          }
          if (d != null) {
              d = null;
          }
      }
  }
  </code></pre>
  
  <p>Classes can be of any type. (Primitives, Lists or Maps)
  I would use <code>clear()</code> or <code>reset()</code> functions if available.</p>
  
  <p>Is this <strong>really</strong> helpful for GC or should I let Java handle this on it's own?</p>