This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: gcj mingw32 and java memory footprint.


On Tue, 18 Feb 2003, Norbert Frese wrote:
> for(int i=0;i<1000;i++)  {
>          AnyClass ref = new AnyClass();
>          ref = null;
> }
>
> this loop would quickly create 1000 instances of AnyClass on the heap,
> which are all garbage.

It isn't certain this will leave 1000 dead objects on the heap.  Garbage
collection can occur during this loop, in which case at least some of the
objects will be reclaimed and potentially re-allocated.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]