Note that the layout of the used memory will be quite different. Your Foo object will use a single piece of 2 Gb of memory - while the Bar object will use 2 million pieces of about 1 kb. That will come from different pools, both on Perl, as on the OS level. And will be treated differently.

In reply to Re: Memory is not released back to operating system by JavaFan
in thread Memory is not released back to operating system by bloonix

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":