Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this the OS heap or the heap maintained by the JVM? Why

Showing Answers 1 - 47 of 47 Answers

subbarayulu

  • Sep 11th, 2005
 

yes the JVM maitain a cache by itself.No it allocates the objects in stack ,in heap on references

  Was this answer useful?  Yes

jFreak

  • Apr 10th, 2007
 

Yes, the JVM maintains a cache.

It creates the Objects on the HEAP, but references to those objects are on STACK.

-- S

  Was this answer useful?  Yes

SANKET

  • Apr 17th, 2007
 

JVM maintain the cache itself.

About the object,
For Each Object JVM Allocate Memory for that Object in Heap.
And starting mem-location is store in stack for referance for that created object.

  Was this answer useful?  Yes

swapna

  • Apr 20th, 2007
 

The JVM's heap stores all the objects created by the executing java program.

Stack stores the object references.

  Was this answer useful?  Yes

vikas verma

  • May 29th, 2007
 

There are two kinds of memory used in Java.
These are called stack memory and heap memory.
Stack memory stores primitive types and the addresses of objects.
The object values are stored in heap memory.
An object reference on the stack is only an address that refers to the place in heap memory where that object is kept.

  Was this answer useful?  Yes

vikas verma

  • May 29th, 2007
 

yes the JVM maintain a cache by itself. There are two kinds of memory used in Java. These are called stack memory and heap memory. Stack memory stores primitive types and the addresses of objects. The object values are stored in heap memory. An object reference on the stack is only an address that refers to the place in heap memory where that object is kept.

Gajendra Kumar Garg

  • Jun 6th, 2007
 

Yes the JVM itself maintain the cache and the heap and the all the primitive type and objects are stored in a heap and the reference to all are stored in stack

  Was this answer useful?  Yes

Sivakumar Karuppiah

  • Aug 14th, 2007
 

No.

JVM reserve the memory space in heap for objects. But the Stack holds the reference of the object.

This Heap is maintained by the JVM. So that, the JVM's Garbage collector can watch the application stack and clear the Heap memory.

  Was this answer useful?  Yes

BhuvanHere

  • Oct 1st, 2007
 

Yes, It is...
The Java runtime system stores information in two separate parts of memory: the stack and the heap.
The heap stores all objects and all static variables.
The stack stores all local variables of methods (and parameters of methods are just local variables).

  Was this answer useful?  Yes

arun paria

  • Oct 10th, 2007
 

yes, JVM maintain a cache itself. JVM always create object in the heap memory area, and referance is stored in the stack.
yes, this heap maintained by JVM because when we run the application at first JVM send request to the OS for allocating the memory to execute the application and after the execution JVM release the memory.

  Was this answer useful?  Yes

meher.jogeswar

  • Oct 18th, 2007
 

yes java maintain a cache by itself.
as we know that java is platform independent. but jvm is platform dependent. but java byte code can be run in any platform. when java is install, jvm takes it's operating system as which it is installed. so when we compiled a program it will allocate to store memory of its os to store filed & attribute.
object ,when created first store in heap area.but it's field value is store in stack area.
we can store the value to heap area by call by reference method.

  Was this answer useful?  Yes

ch.ramachandrakumar

  • Nov 16th, 2007
 

Whenever the object is created by the JVM, the object is allocated in the free space called heap. The object reference placed in the frame, which is the smallest part in the stack. (stack is built up of many smallest frames). (frame is the smallest memory in the stack).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions