Showing posts with label memory. Show all posts
Showing posts with label memory. Show all posts

Tuesday, August 13, 2013

How many objects are created when you create an object of a plain class?

This is shared out of a random thought. Let’s say we’ve got two classes:
class A{}
class B extends A{
 static B obj = new B();
}
Do not read further until you have the answer to the question.

Wednesday, January 2, 2013

JVM - the runtime data areas (Part 2/2)

Part 2 is continuation of Part 1. If you have not read Part 1 or want to review, please head here.

I have created some independent images which have a small program on each and the memory allocation being shown. As I informed in Part 1, our main concern will be three runtime areas, viz., Method Area, Heap Area, and Java Stacks Area, so I have only shown them in the following explanations.

JVM - the runtime data areas (Part 1/2)

Hi, This is Part 1 of a 2 part series that unfolds the abstract view of runtime memory allocation. You will understand how the variables get memory, how methods are created, how the control might flow. I have explained it in layman's language, for insight I will add links to a few external resources. Link to part 2 is provided at the bottom of this article.