Outcomes
01 Physical versus Virtual Memory
02 Virtual Memory Organization
03 Heap Memory
04 C Pointer versus C++ Reference http://notebooks.com/2013/1
0/29/how-to-choose-the-
05 C Array versus C++ Vector right-memory-for-your-
notebook/
06 Function overload
07 Function pointer
08 C++ File I/O
01 Physical Versus Virtual Memory
(1) Each program (our .exe program) is
called a process with an ID. Each
process has his own memory
organization i.e. has collection of
instructions (code) and data. This
organization is called virtual
memory.
(2) Windows Memory Manager maps
each process virtual memory to
the actual physical memory.
(3) Thus each process occupies
different physical addresses
although each process has similar
virtual memory address.
(4) For example, both processes can
have the same virtual memory
address; but will have different
location in physical address.
(5) Look at the size of virtual memory
– for 64-bit addressing, the
memory starts at 0x00000000 to
0xFFFFFFFF.
01 Physical Versus Virtual Memory
(1) I had created two similar programs and print out the
address of an integer and a double.
(2) I had ran the program simultaneously. Both variables Two processes are running
share the same addresses. on Windows OS at one
(3) The address is the virtual memory address. time. Both variable a and
(4) The operating system maps the virtual address into d have the same address.
the actual physical address (RAM).
(5) Can you find the process ID?
02 Virtual Memory