1

00:00:00,810  -->  00:00:01,950
Hi there.

2

00:00:02,160  -->  00:00:09,630
Now let's look at runtime data areas which is nothing but a memory that is associated with JVM getting

3

00:00:09,630  -->  00:00:15,600
a good understanding of this topic is very important for performance tuning as well as to handle memory

4

00:00:15,600  -->  00:00:21,630
related errors like out of memory errors because the names are just happen when you run out of memory

5

00:00:23,820  -->  00:00:29,700
any process when it starts up gets a chunk of memory from the underlying operating system.

6

00:00:29,700  -->  00:00:32,530
This memory is referred to as Nathu memory.

7

00:00:32,670  -->  00:00:39,030
The process will also have its own virtual address space which maps to physical memory or any file or

8

00:00:39,030  -->  00:00:46,750
any addressable storage this virtual or dismiss will have two parts user space and corner space kernel

9

00:00:46,770  -->  00:00:48,770
space is where the kernel resides.

10

00:00:48,930  -->  00:00:51,980
And this base is shared by all the processes.

11

00:00:52,530  -->  00:00:55,680
Hello to the user base is unique to each process.

12

00:00:55,920  -->  00:00:58,700
And that's basically the native memory too.

13

00:00:58,710  -->  00:01:03,590
And that's where the user programs are stored on a 32 bit Windows machine.

14

00:01:03,690  -->  00:01:09,220
By default the process gets to G-B of userspace and G-B of kernel space.

15

00:01:09,540  -->  00:01:17,030
Whereas on a 32 bit Linux machine by default it would be 3G by userspace and 1G be canon space in case

16

00:01:17,040  -->  00:01:22,470
you're not familiar with concepts like we're toilet does space which is related to what you memory then

17

00:01:22,470  -->  00:01:28,230
I would strongly recommend reading the book operating system concepts but Silber shots.

18

00:01:28,620  -->  00:01:33,570
Not a good one or more really good pointers in the resources section and you can take a look at them

19

00:01:33,570  -->  00:01:38,610
do not come into JVM as JVM is also a process.

20

00:01:38,610  -->  00:01:44,280
It also gets its share of knaidel memory which it splits into multiple sub areas for storing different

21

00:01:44,280  -->  00:01:46,030
things.

22

00:01:47,130  -->  00:01:52,120
Here's an illustration of GBM architecture which we have seen at the beginning of the chapter.

23

00:01:52,380  -->  00:01:59,340
As you can see at the top we have different sub areas within DBMSs memory which is nothing but the userspace

24

00:01:59,460  -->  00:02:01,680
associated with JVM.

25

00:02:01,680  -->  00:02:05,140
So these are the different runtime data areas off JVM.

26

00:02:05,430  -->  00:02:11,750
Non-death briefly look at what these areas are and later we will discuss each of them in detail.

27

00:02:12,030  -->  00:02:16,170
So here you can see only the memory area of the JVM architecture.

28

00:02:16,170  -->  00:02:18,790
I just added one additional box for Naidu heap.

29

00:02:19,110  -->  00:02:26,310
And I also rename heap to Jahi just to make it more clear and distinguish it from Naidu heap.

30

00:02:26,340  -->  00:02:32,980
Although we have only a small box on native heape to be more precise Naboo heap is actually the total

31

00:02:33,020  -->  00:02:36,190
userspace area minus the Jahi.

32

00:02:36,660  -->  00:02:42,330
Hello Dallas blitz this nigga area in several other areas as we can see here.

33

00:02:42,380  -->  00:02:47,790
So whatever is remaining is generally referred to as Nathu he ordinated memory.

34

00:02:47,790  -->  00:02:54,310
Other terms like CPP or Mullarkey are also used for native here.

35

00:02:54,310  -->  00:02:57,660
No we already know what a heap are Java heap is.

36

00:02:57,670  -->  00:03:03,810
It basically stores Djala objects which would also include race and class objects.

37

00:03:03,810  -->  00:03:09,480
We know the class can create class objects and we also know that even be developers can create class

38

00:03:09,510  -->  00:03:16,920
objects as we saw on reflection setting a proper Java heap size is very important for good performance

39

00:03:16,920  -->  00:03:19,240
on production systems.

40

00:03:19,320  -->  00:03:24,540
Later when me look at Java heap we will also look at couple of Flack's specific to setting up Joe a

41

00:03:24,540  -->  00:03:27,610
heap size.

42

00:03:27,900  -->  00:03:34,360
Next Mediterranea contents class data which would be all the data up but end into a class dappling good

43

00:03:34,400  -->  00:03:40,740
Mad-Eye information of the class like the fully qualified class name super class name and so on which

44

00:03:40,740  -->  00:03:43,720
we could get using class object method.

45

00:03:43,730  -->  00:03:48,920
I would also include the actual bytecode of each method and there are a few other things that would

46

00:03:48,930  -->  00:03:52,030
be part of Metro area and we will look at them later.

47

00:03:52,620  -->  00:03:58,950
Basically for every object on the heap we have it's corresponding class data in the method area.

48

00:03:59,040  -->  00:04:03,250
Multiple objects of the same class will point to the same class data.

49

00:04:03,900  -->  00:04:09,360
Just know that both methods area and heape are shared across all the threads.

50

00:04:09,390  -->  00:04:13,830
We know that Djala can multitask by running multiple threads at the same time.

51

00:04:14,040  -->  00:04:19,340
So if you have multiple threads then all of them will share the same method area and the same heap.

52

00:04:19,770  -->  00:04:23,930
But as you can see there are certain things specific to each thread.

53

00:04:25,020  -->  00:04:28,130
One of them is stack which is very important.

54

00:04:28,130  -->  00:04:30,440
It is a good method in location's date.

55

00:04:30,720  -->  00:04:33,100
That is the order of invocation of methods.

56

00:04:33,510  -->  00:04:39,750
It would in good information about local variables within each method in one of the follow up lessons

57

00:04:39,860  -->  00:04:43,560
we would like to look at stock and didn't like stack.

58

00:04:43,560  -->  00:04:45,070
There is also a separate stack.

59

00:04:45,090  -->  00:04:47,010
Just need two methods.

60

00:04:47,010  -->  00:04:51,840
So what would it cost with a GBM stack on this stack specifically specific two methods.

61

00:04:51,960  -->  00:04:57,210
Sometimes Delap programs might in work metters a native code which could be applications that are done

62

00:04:57,210  -->  00:05:05,070
in native compiler languages such as C and C++ JVM itself relies heavily on native code to do stuff

63

00:05:05,070  -->  00:05:08,120
like file and network input output.

64

00:05:08,160  -->  00:05:09,830
Then there is program pointer.

65

00:05:10,140  -->  00:05:16,620
It is Ignoto instructor pointer in native Scipio's it would hold the memory address of the next instruction

66

00:05:17,070  -->  00:05:17,580
.

67

00:05:17,640  -->  00:05:24,000
What that means is it is simply a pointer to a memory address in the method area as method areas where

68

00:05:24,000  -->  00:05:25,680
we have the real method called.

69

00:05:25,740  -->  00:05:27,870
That is a method by course.

70

00:05:28,140  -->  00:05:34,760
So all these three Jalla stack natives stack and B C are maintained for each thread.

71

00:05:34,770  -->  00:05:40,260
Finally the left already has a native heap and it can include stuff like code that is compiled by just

72

00:05:40,260  -->  00:05:41,910
in time compiler.

73

00:05:42,150  -->  00:05:48,930
Recall that the compiler compiles frequently use bytecode into machine code and stores them for future

74

00:05:48,930  -->  00:05:56,370
use for faster performance so that code is stored here on the native heap Naidu memory can also have

75

00:05:56,370  -->  00:06:02,910
a special kind of objects called Direct buffers which can be very useful when you want to cache lots

76

00:06:02,910  -->  00:06:09,570
of data so that's a high level overview of the different runtime data areas in the user space of JVM

77

00:06:09,570  -->  00:06:10,650
.

78

00:06:10,650  -->  00:06:16,160
Next we will discuss some of these areas and didn't specifically will discuss about matter area Java

79

00:06:16,170  -->  00:06:17,930
heap on the Java stack.

80

00:06:18,510  -->  00:06:19,350
Did it before.

81

00:06:19,340  -->  00:06:22,330
We will most likely go in the chapter.

82

00:06:22,330  -->  00:06:27,690
We will also be coding garbage collector which is the compering that is responsible for automatic memory

83

00:06:27,690  -->  00:06:30,330
management and that's about it.

84

00:06:30,360  -->  00:06:32,520
With a high level overview of JVM memory
