I was under the impression that primitives are heap managed when they're inside
an object:
public class Foo { public int bar; }
And of course they're stack managed otherwise:
public void func(int foo) { int bar; }
Alexey
2001 Honda CBR600F4i (CCS)
1992 Kawasaki EX500
http://azinger.blogspot.com
http://bsheet.sourceforge.net
http://wcollage.sourceforge.net
________________________________
From: pramod nepal <[email protected]>
To: [email protected]
Sent: Monday, July 20, 2009 1:08:26 PM
Subject: [The Java Posse] Re: Heap and Stack memory
Stack and heap are both memories of RAM. Stack is a common place for
most of memory storage. Both of these allocated memory inside jvm.
Heap is a dedicated memory storage created only when we initialize
using the new operator. They are easily freed or garbage collected
when no more required. Objects created from classes are stored in
heap. Eg int is stack managed and Integer is heap managed. Storage
algorithm is different. Stack initialized may not properly manage
contigious memory and may waste memory. Each heap initalized gets
contigious memory. After object is freed memory re-organizes to claim
original space and re constructs to leave no free space betwn two
managed objects
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---