• Barajar
    Activar
    Desactivar
  • Alphabetizar
    Activar
    Desactivar
  • Frente Primero
    Activar
    Desactivar
  • Ambos lados
    Activar
    Desactivar
  • Leer
    Activar
    Desactivar
Leyendo...
Frente

Cómo estudiar sus tarjetas

Teclas de Derecha/Izquierda: Navegar entre tarjetas.tecla derechatecla izquierda

Teclas Arriba/Abajo: Colvea la carta entre frente y dorso.tecla abajotecla arriba

Tecla H: Muestra pista (3er lado).tecla h

Tecla N: Lea el texto en voz.tecla n

image

Boton play

image

Boton play

image

Progreso

1/47

Click para voltear

47 Cartas en este set

  • Frente
  • Atrás
The maximum amount
of physical memory currently supported by Windows
ranges from 2 GB to 24 TB
the memory manager has two primary tasks
*Translating, or mapping, a process’s virtual address space into physical memory
*Paging some of the contents of memory to disk when it becomes overcommitted
Translating, or mapping, a process’s virtual address space into physical memory
when a thread running in the context of that process reads or writes to the virtual address space, the correct physical address is referenced.
Paging some of the contents of memory to disk when it becomes overcommitted
when running threads try to use more physical memory than is currently available—and bringing the contents back into physical memory when needed.
HAL
Hardware Abstraction Layer: layer of software that interacts between the hardware and the rest of the operating system
What is the Memory manager?
it is part of the Windows executive and therefore exists in the file Ntoskrnl.exe
Components of the memory manager
*A set of executive systems in charge of allocate and deallocate virtual memory
*A fault trap, to handle the memory exceptions
*Six key top-level routines running in their own thread
The six key top-level routines of the memory manager
*The balance set manager (keBalanceSetManager, priority 17)
*The process/stack swapper (KeSwapProcessOrStack, priority 23)
*The modified page writer (MiModifiedPageWriter, Priority 18)
*The mapped page writer (MiMapedPageWriter, priority 18)
*The segment deference thread (MiDeferenceSegmentThread, priority 19)
*The zero page thread (MiZeroPageThread, priority 0)
The balance set manager
This calls an inner routine, the working set manager (MmWorkingSetManager), once per second as well as when free memory falls below a certain threshold.
The working set manager
drives the overall memorymanagement policies, such as working set trimming, aging, and modified page writing.
What does the The process/stack swapper?
This performs both process and kernel thread stack inswapping and outswapping.
What does the modified page writer?
This writes dirty pages
on the modified list back to the appropriate paging files.
What does The mapped page writer
This writes dirty pages in mapped files to disk or remote storage.
What does the segment dereference thread
This is responsible for cache reduction as well as for page file growth and shrinkage.
What does the zero page thread
This zeroes out pages on the free list so that a cache of zero pages is available to satisfy future demand-zero page faults.
Page size
x86, 4KB→ 2MB =512
x64, 4KB→ 2MB=512
ARM, 4KB→ 4MB=1024
Primary advantage of large pages
Speed, it uses less TLB´s to translating the adresses
TLB
Translation look-aside buffer, contains the first byte within the page, and iy uses it to translate the adresses into physical memory
What does Windows map?
Windows maps with large pages the core operating system images as well as core operating system data. Windows allows to the applications to map their images, private memory and page file-backed sections with large pages
What could make the attemptps to allocate large pages fail?
When the operating system has been running for a long time, because a large page uses a large amount of contiguous small pages, and memory could become fragmented, this may not affect small pages, but will affect large pages.
Huge pages
Pages of 1GB of size, if a allocation request needs more than one huge page, it could use one plus some other larger pages
Disadvantage of large pages
If a block of read only code is put along with a writable part of code, the whole page is marked as write/read page, and a malicious attempt, or just a bug, could modify a critical part of the code and the respective memory access violation won´t appear.
VMMap
This shows the usage of virtual memory within a process to a fine level of detail.
RAMMap
This shows detailed physical memory usage.
!vm command
Shows the basic memory management information available through the memory related performance counters. This command can be useful if you’re looking at a crash dump or hung system.
Internal synchronization
The memory manager supports simultaneous execution on multiprocessors systems
Some of the resources which the memory manager must control access
■Dynamically allocated portions of the system virtual address space
■ System working sets
■ Kernel memory pools
■ The list of loaded drivers
■ The list of paging files
■ Physical memory lists
■ Image base randomization address space layout randomization (ASLR) structures
■ Each individual entry in the page frame number (PFN) database
Working set lock
Needs synchronization, This is held while changes are made to the working set list.
Address space lock
Needs synchronization, This is held whenever the address space is being changed.
State
is a particular arrangement of bits. For example, if you have four bits in your memory, 0110, 0001, and 1011 represent three different states
image
particular physical arrangement of bits.
Tasks of kernel´s memory management
• The kernel must have its own private area in memory that user processes can’t access.
• Each user process needs its own section of memory.
• One user process may not access the private memory of another
process.
• User processes can share memory.
• Some memory in user processes can be read-only.
• The system can use more memory than is physically present by using
disk space as auxiliary.
MMU
Memory Manage Unit, translates the virtual memory addresses used by processes into real ones
page table
The implementation of a memory address map
on-demand paging
A user process does not actually need all of its pages to be immediately available in order to run. The kernel generally loads and allocates pages as a process needs them
page fault
a memory page is not ready when a process wants to use it, the process triggers it
Minor Page Faults
occurs when the desired page is actually in main memory but the MMU doesn’t know where it is. This can happen when the process requests more memory or when the MMU doesn’t have enough space
to store all of the page locations for a process.
Major Page Faults
occurs when the desired memory page isn’t in main
memory at all, which means that the kernel must load it from the disk or some other slow storage mechanism.
command "time"
displays page faults
command "top"
Shows the page faults of processes as they’re running
command "ps"
you can use a custom output format to view the page
faults for a particular process
vmstat procs
for processes
vmstat memory
for memory usage
*The buff column indicates the amount of memory that the kernel is using for disk buffers
vmstat swap
for the pages pulled in and out of swap
* si (swap-in)
* so (swap-out)
vmstat io
for disk usage
vmstat system
for the number of times the kernel switches into kernel code
vmstat cpu
for the time used by different parts of the system
*us= the percentage of time that the CPU is spending on user tasks,
*sy = system (kernel) tasks,
*id = idle time
*wa = waiting for I/O