Re: array initilization and memory usage
- From: dsjoblom@xxxxxx
- Date: 28 Jun 2006 07:31:08 -0700
ge0rge wrote:
Incorrect.
Bar bar[500]; allocates 500 references on the stack - no big space
requirement ... but each new Bar() will allocate a Bar object on the heap and
the space requirement for a Bar instance.
Not correct about the stack allocation part. There is no way of knowing
where the Bar array (the piece of memory having space for 500
references) is allocated, unless you know the internal operations of
your JVM, but that is not portable information. Most *likely* it is
allocated on the heap as any other object. Typically, only local
primitives and references are allocated on the stack.
Regards,
Daniel Sjöblom
.
- References:
- array initilization and memory usage
- From: jon23d
- Re: array initilization and memory usage
- From: Xavier Tarrago
- Re: array initilization and memory usage
- From: ge0rge
- array initilization and memory usage
- Prev by Date: Re: Possible to use reflection to get constructor params/args
- Next by Date: Re: generics & their syntax
- Previous by thread: Re: array initilization and memory usage
- Next by thread: Problem with JFormattedTextField - Number field
- Index(es):
Relevant Pages
|