Compute memory required to allocated objects
<p>I would like to compare memory usage, to allocate Calendar object and Joda's DateTime object.</p>

<pre><code>// How much memory required to allocate 100 Calendar objects?
for (int i = 0; i &lt; 100; i++) {
    Calendar c = Calendar.getInstance();
    l = l + c.getTimeInMillis();
    CalendarList.add(c);
}

// How much memory required to allocate Joda TimeDate objects?
for (int i = 0; i &lt; 100; i++) {
    DateTime dateTime = new DateTime();
    l = l + dateTime.getMillis();
    DateTimeList.add(dateTime);
}
</code></pre>

<hr>

<p>May I know is there any code I can add in to measure?</p>
