How does java allocate heap and stack memory?, JAVA Programming

Each time an object is started in Java it goes into the area of memory named as heap. The primitive variables like double and int are allocated in the stack, if they are local instances and in the heap if they are member variables. In Java functions and local variables are pushed into stack when a function is called and stack pointer is decremented when a method invoke is finished. In a multi-threaded application each thread may have its own stack but will share the similar heap. That is why care could be taken in your code to avoid any concurrent access concern in the heap space. The stack is thread-safe because each and every thread will have its own stack with say 1MB RAM allocated for each thread but the heap is not thread-safe unless protected with synchronization through your code. The stack space may be increased with the -Xss option.

Posted Date: 7/25/2012 2:25:41 AM | Location : United States







Related Discussions:- How does java allocate heap and stack memory?, Assignment Help, Ask Question on How does java allocate heap and stack memory?, Get Answer, Expert's Help, How does java allocate heap and stack memory? Discussions

Write discussion on How does java allocate heap and stack memory?
Your posts are moderated
Related Questions
Develop a Client/Server (MySQL) student record application Project Description: I need a client/server application with a MySQL backend database. The prototype could interfac

pls telme source code for Padovan String

Explain DATA SECURITY Management issue? All data in the system is extremely critical to its operation, the security of the customer's personal data is most important. Most of t

i want a full program with test about the following: linkedComputers: We will assume that a number of methods are required. These are specified below. String getComputerName() ret

there are N nodes in a graph, the graph isuni directional with M edges of these M nodes in a graph, there are K nodes which are important nodes. given initial position I within thi

Plug-in for Adobe after Effects Project Description: We are seeking software engineers to create a plug-in for Adobe after Effects (CS4 and above) that allows 3D extrusions f

The process of applying aspects to a target object to form a new proxy object is known as Weaving. The aspects are woven into the target object at the verified join points.

Search on column demonstration in Semantic Vector Project Description: I am preparing a research on Semantic Vectors. But I am not able to check out in a vector representa

Colossus has just purchased a computer for its new automated reservation system. You have been asked to program the new system.  You are to write a program to assign seats on ea

Want a ANTI Iframe Breaker Project Description: I want an ANTI Iframe Breaker code made, so that if I'm iframing a site, that contains JavaScript, flash or otherwise, to forc