title: NPE when calling getObjectSize()
body: <p>In reference to  : <a href="https://stackoverflow.com/questions/9368764/calculate-size-of-object-in-java">Calculate size of Object in Java</a></p>
  
  <p>I tried to run this program and get the size of the object created </p>
  
  <pre><code>  //main 
   while(true){
          Integer x=new Integer(50);
          System.out.println("HashCode of this object="+x.hashCode()+" 
                    ,  with Size of "+ObjectSizeFetcher.getObjectSize(x));
          i++;
  }
  
   The output -- NullPointerException is thrown when getObjectSize() is invoked.
  
     new Integer() --&gt;
  </code></pre>
  
  <p>should have created a new wrapper object. Instead it creates NPE. Why ?</p>
  
  <p>java version "1.6.0_65"
  Apple OSX - 10.9.1 
  --Ignore Syntax errors</p>