Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:07,120 --> 00:00:12,490
In this lecture, we will learn about the heap and the stark memory and a C sharp program can either
2
00:00:12,490 --> 00:00:14,530
be allocated to the stack or the heap.
3
00:00:15,090 --> 00:00:17,230
The stack is a contiguous block of memory.
4
00:00:17,860 --> 00:00:20,770
Memory gets allocated to the stack when a function is called.
5
00:00:21,400 --> 00:00:24,460
Once the function is over, that memory is D allocated.
6
00:00:24,910 --> 00:00:30,550
The programmer does not have to worry about allocating or d allocating the stack memory that is handled
7
00:00:30,580 --> 00:00:32,050
automatically by the computer.
8
00:00:32,830 --> 00:00:36,940
The stack is a block of memory for storing local variables and parameters.
9
00:00:37,360 --> 00:00:40,600
It grows and shrinks as a function is entered and exited.
10
00:00:41,260 --> 00:00:44,590
The heap is memory that is allocated explicitly by programmers.
11
00:00:45,010 --> 00:00:49,750
It is basically a pile of memory space available for programmers to allocate and d allocate.
12
00:00:50,380 --> 00:00:55,480
When a programmer does not properly handle this memory, something called a memory leak can happen in
13
00:00:55,480 --> 00:00:56,140
the program.
14
00:00:56,650 --> 00:01:01,720
A memory leak happens when a programmer assigns a block of memory in the heap and then forgets to d
15
00:01:01,720 --> 00:01:05,110
allocate that block of memory to avoid a memory leak.
16
00:01:05,260 --> 00:01:08,620
The programmer should always free the memory when it is no longer needed.
17
00:01:09,160 --> 00:01:14,920
A heap is a block of memory for storing objects, for example, reference type instances when a new
18
00:01:14,920 --> 00:01:16,000
object is created.
19
00:01:16,210 --> 00:01:19,990
It is allocated on the heap and a reference to that object is returned.
20
00:01:20,620 --> 00:01:23,350
The heap starts filling up as new objects are created.
21
00:01:23,950 --> 00:01:27,520
The garbage collector periodically D allocates objects from the heap.
22
00:01:28,180 --> 00:01:34,570
The heap also store static fields and constants which don't get garbage collected in the next lecture.
23
00:01:34,930 --> 00:01:38,650
We will learn about the five steps to programming systems and applications.
2422
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.