Documente Academic
Documente Profesional
Documente Cultură
32-bit memory addressing Memtoleave 64-bit memory addressing Query/Workspace Memory Procedure Cache
0x7FFFFFFF
0001 0010 0101 10 0110 0000 1001 00 0101 0000 1101 00 0110 0111 1100 00
0x00000000
2GB
0x7FFFFFFF
Page file
0001 0010 0111 11 0110 0000 1001 00 0101 0000 1101 00 0110 0111 1100 00
0x00000000
2GB
0xFFFFFFFF
0xC0000000
0xBFFFFFFF
0x80000000 0x7FFFFFFF
> 2 GB virtual address space /3GB switch in boot.ini /LARGEADDRESSAWARE System PTEs Paged Pool Non_Paged Pool
0x00000000
Symptoms
Server stops responding
Maximum values determined at boot time Examples for Windows 2003 SP1:
System RAM 512MB 1024MB 1536MB 2048MB NonPaged Max 125MB 202MB 254MB 252MB Paged Max 184MB 168MB 352MB 352MB
0xFFFFFFFF
0xFFFFFFFF
0xC0000000 0xBFFFFFFF
0x80000000 0x7FFFFFFF
AWE
Address Windowing Extensions
0101 1111 1001 0001 0000 0000 1100 1101 1101 1111
0x00000000
Area of SQL Server address space Outside the buffer pool Linked servers, XPs, COM objects Multi-Page Allocator (MPA)
<8KB handled by Single-Page Allocator
Error
"WARNING: Failed to reserve contiguous memory of Size= 65536."
32-bit computer 256MB base value <= 4 cpu cores = 256 workers 256*0.5MB = 128MB Memtoleave = 384MB
Buffer Pool will never be more than physical RAM 1GB RAM VAS/memtoleave: 834MB!
264
=18,446,744,073,709,551,616 =17,179,869,184 TB = 16 EB
2 flavours
x64 created by AMD for server and desktop IA64 strictly patented by Intel and HP for servers
Windows XP x64 announced Intel responds with x64 compatible extensions called EM64T AMD renamed their implementation AMD64 Intel renamed theirs to Intel64 We now refer to x64 as meaning either platform
64-bit computer 256MB base value <= 4 cpu cores = 512 workers 512*2MB = 1024MB Memtoleave = 1280MB 7.99TB of VAS left!
By default SQL engine will not acquire all requested memory upon startup Configure Max Server Memory
Leave some headroom for the OS and for memory requests outside the buffer pool
Scenario 8 cores, 32GB RAM 2GB for the OS 1GB for worker threads 1GB for Multi-page allocations, linked servers etc 1GB for backup program = 5GB Max Server Memory to 27GB
SQL Server responds to memory pressure If its not quick enough Windows can aggressively trim SQL Servers working set New message in SP2
A significant part of SQL Server process memory has been paged out. This may result in a performance degradation.
A user must have the Lock Pages in Memory privilege to use the AWE APIs
On 64-bit the AWE APIs are used to lock pages in the working set
AWE enabled option in sp_configure ignored on 64-bit
http://support.microsoft.com/kb/918483
120 20
140 60
120
150
180 60 80
Free Used
120
80
120
100
DBCC MEMORYSTATUS
Query Memory Objects Small Query Memory Objects
sys.dm_os_wait_stats RESOURCE_SEMAPHORE
Procedure Cache
Allocated from the buffer pool Query Plans Stored in Procedure Cache
Compiled plan Executable plan Parse tree Extended stored procedure sys.dm_exec_cached_plans to see the entries in the
cache
DBCC MEMORYSTATUS to see the size of the cache