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
YES. JSP technology is extensible by the development of custom actions, or tags, which are encapsulated in tag libraries. #question..

Project Description: I want to create similar site: fifacointrader I want similar site like fifacointrader.com Skills required are HTML, Java, PHP, Website Design, Wordpre

Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in th

Explain java flow control ? if else else if while for do while switch case break continue goto is a reserved word.

• A Graph Data Type (including a display method to show adjacencies) • A Cycle Checker (as described in lecture notes) • An Edge class • A sorting algorithm to sort an array of Edg

I want a Script developer who will make script for me and if you can show good works there are bonuses too. Skills required are Facebook Marketing, Java, Javascript, PHP, and Sc

write algorithm to perform the following operations on it create,insertion,deletion,for testing overflow and empty conditions.

Question: (a) State and explain clearly FIVE new features of Actionscript 3.0 as compared to Actionscript 2.0. (b) Explain clearly the concept of events and events listen

how to quit from unlimitedly executing applet

Create a thread in either a C or a Java program and run it. The thread should read a keyboard value "x" and exit from the code, or it can also use an "ESC" to exit. That is, the t