title: Precautions to make less use of Heap space while programming
body: <p>These occupies space in heap</p>
  
  <p><strong>String</strong>: wise use of String, try to use as local variables, make sure that there are no string without references  and try to use StringBuffer or StringBuilder</p>
  
  <p><strong>static</strong>: wise use of static </p>
  
  <p><strong>Instance variables</strong>: try to declare variables locally as far as possible</p>
  
  <p><strong>objects</strong>: reuse as far as possible</p>
  
  <p>Please correct me if so far I am wrong…also suggest any more precautions that I can take to reduce the usage of Heap space while programming in Java</p>