社区
系统维护与使用区
帖子详情
could not allocate requested partitions
zmanz
2003-08-29 04:07:11
我机子上装了win2000 adv,c(主分区),d盘(扩展分区)
harddisk上还预留了20G未指派空间。
我想在这20G上装linux时,/boot 40M swap 256M,但是在指派/剩余全部空间的时候,弹出could not allocate requested partitions.
为什么?
...全文
692
4
打赏
收藏
could not allocate requested partitions
我机子上装了win2000 adv,c(主分区),d盘(扩展分区) harddisk上还预留了20G未指派空间。 我想在这20G上装linux时,/boot 40M swap 256M,但是在指派/剩余全部空间的时候,弹出could not allocate requested partitions. 为什么?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ywops
2004-02-20
打赏
举报
回复
我也遇到了楼主提出的问题。
可是如果把linux装在扩展分区,怎么才能实现win2000和linux的双启动呢?(我的电脑里原来装了个win2000)
其实我也曾将linux装在扩展分区,但是怎么也不能实现win2000和linux的双启动,请各位大侠多多指教,谢谢!
一只肥兔
2003-08-30
打赏
举报
回复
我也遇到此种问题过。上次我在LINUX下指定SWAP和EXT3时就出现了楼主的问题,我就用这个方法解决的:
我在DOS下用PQMagic把分区全部分好
LINUX的分区也分好2个分区:一个格式化为swap分区,一个格式化为EXT2/3
再继续安装就不会出现上面的问题。
我用的是Red Hat Linux8.0
ayiiq180
2003-08-30
打赏
举报
回复
同意pandeng711,如果你的主分区超过了4个,就会出现这种问题
其实linux的分区可以全部放在扩展分区中
pandeng711
2003-08-29
打赏
举报
回复
是不是你的/boot和swap都是划在主分区?主分区只能有4个,c盘占了一个,扩展分区又占了一个,只有两个。看你怎么分了。
微软内部资料-SQL性能优化2
Contents Module Overview 1 Lesson 1: Memory 3 Lesson 2: I/O 73 Lesson 3: CPU 111 Module 3: Troubleshooting Server Performance Module Overview Troubleshooting server performance-bas
ed
support calls requires product knowl
ed
ge, good communi
cat
ion skills, and a proven troubleshooting methodology. In this module we will discuss Microsoft® SQL Server™ interaction with the operating system and methodology of troubleshooting server-bas
ed
problems. At the end of this module, you will be able to: Define the common terms associat
ed
the memory, I/O, and CPU subsystems. Describe how SQL Server leverages the Microsoft Windows® operating system facilities including memory, I/O, and threading. Define common SQL Server memory, I/O, and processor terms. Generate a hypothesis bas
ed
on performance counters captur
ed
by System Monitor. For each hypothesis generat
ed
, identify at least two other non-System Monitor pieces of information that would help to confirm or reject your hypothesis. Identify at least five counters for each subsystem that are key to understanding the performance of that subsystem. Identify three common myths associat
ed
with the memory, I/O, or CPU subsystems. Lesson 1: Memory What You Will Learn After completing this lesson, you will be able to: Define common terms us
ed
when describing memory. Give examples of each memory concept and how it applies to SQL Server. Describe how SQL Server user and manages its memory. List the primary configuration options that affect memory. Describe how configuration options affect memory usage. Describe the effect on the I/O subsystem when memory runs low. List at least two memory myths and why they are not true. Recommend
ed
Reading SQL Server 7.0 Performance Tuning Technical Reference, Microsoft Press Windows 2000 Resource Kit companion CD-ROM documentation. Chapter 15: Overview of Performance Monitoring Inside Microsoft Windows 2000, Third
Ed
ition, David A. Solomon and Mark E. Russinovich Windows 2000 Server Operations Guide, Storage, File Systems, and Printing; Chapters: Evaluating Memory and Cache Usage Advanc
ed
Windows, 4th
Ed
ition, Jeffrey Richter, Microsoft Press Relat
ed
Web Sites http://ntperformance/ Memory Definitions Memory Definitions Before we look at how SQL Server uses and manages its memory, we ne
ed
to ensure a full understanding of the more common memory relat
ed
terms. The following definitions will help you understand how SQL Server interacts with the operating system when
allo
cat
ing and using memory. Virtual Address Space A set of memory addresses that are mapp
ed
to physical memory addresses by the system. In a 32-bit operation system, there is normally a linear array of 2^32 addresses representing 4,294,967,269 byte addresses. Physical Memory A series of physical lo
cat
ions, with unique addresses, that can be us
ed
to store instructions or data. AWE – Address Windowing Extensions A 32-bit process is normally limit
ed
to addressing 2 gigabytes (GB) of memory, or 3 GB if the system was boot
ed
using the /3G boot switch even if there is more physical memory available. By leveraging the Address Windowing Extensions API, an appli
cat
ion can create a fix
ed
-size window into the additional physical memory. This
allo
ws a process to access any portion of the physical memory by mapping it into the appli
cat
ions window. When us
ed
in combination with Intel’s Physical Addressing Extensions (PAE) on Windows 2000, an AWE enabl
ed
appli
cat
ion can support up to 64 GB of memory Reserv
ed
Memory Pages in a processes address space are free, reserv
ed
or committ
ed
. Reserving memory address space is a way to reserve a range of virtual addresses for later use. If you attempt to access a reserv
ed
address that has not yet been committ
ed
(back
ed
by memory or disk) you will cause an access violation. Committ
ed
Memory Committ
ed
pages are those pages that when access
ed
in the end translate to pages in memory. Those pages may however have to be fault
ed
in from a page file or memory mapp
ed
file. Backing Store Backing store is the physical representation of a memory address. Page Fault (Soft/Hard) A reference to an invalid page (a page that is not in your working set) is referr
ed
to as a page fault. Assuming the page reference does not result in an access violation, a page fault can be either hard or soft. A hard page fault results in a read from disk, either a page file or memory-mapp
ed
file. A soft page fault is resolv
ed
from one of the modifi
ed
, standby, free or zero page transition lists. Paging is represent
ed
by a number of counters including page faults/sec, page input/sec and page output/sec. Page faults/sec include soft and hard page faults where as the page input/output counters represent hard page faults. Unfortunately, all of these counters include file system cache activity. For more information, see also…Inside Windows 2000,Third
Ed
ition, pp. 443-451. Private Bytes Private non-shar
ed
committ
ed
address space Working Set The subset of processes virtual pages that is resident in physical memory. For more information, see also… Inside Windows 2000,Third
Ed
ition, p. 455. System Working Set Like a process, the system has a working set. Five different types of pages represent the system’s working set: system cache; pag
ed
pool; pageable code and data in the kernel; page-able code and data in device drivers; and system mapp
ed
views. The system working set is represent
ed
by the counter Memory: cache bytes. System working set paging activity can be view
ed
by monitoring the Memory: Cache Faults/sec counter. For more information, see also… Inside Windows 2000,Third
Ed
ition, p. 463. System Cache The Windows 2000 cache manager provides data caching for both local and network file system drivers. By caching virtual blocks, the cache manager can r
ed
uce disk I/O and provide intelligent read ahead. Represent
ed
by Memory:Cache Resident bytes. For more information, see also… Inside Windows 2000,Third
Ed
ition, pp. 654-659. Non Pag
ed
Pool Range of addresses guarante
ed
to be resident in physical memory. As such, non-pag
ed
pool can be access
ed
at any time without incurring a page fault. Because device drivers operate at DPC/dispatch level (cover
ed
in lesson 2), and page faults are not
allo
w
ed
at this level or above, most device drivers use non-pag
ed
pool to assure that they do not incur a page fault. Represent
ed
by Memory: Pool Nonpag
ed
Bytes, typically between 3-30 megabytes (MB) in size. Note The pool is, in effect, a common area of memory shar
ed
by all processes. One of the most common uses of non-pag
ed
pool is the storage of object handles. For more information regarding “maximums,” see also… Inside Windows 2000,Third
Ed
ition, pp. 403-404 Pag
ed
Pool Range of address that can be pag
ed
in and out of physical memory. Typically us
ed
by drivers who ne
ed
memory but do not ne
ed
to access that memory from DPC/dispatch of above interrupt level. Represent
ed
by Memory: Pool Pag
ed
Bytes and Memory:Pool Pag
ed
Resident Bytes. Typically between 10-30MB + size of Registry. For more information regarding “limits,” see also… Inside Windows 2000,Third
Ed
ition, pp. 403-404. Stack Each thread has two stacks, one for kernel mode and one for user mode. A stack is an area of memory in which program proc
ed
ure or function call addresses and parameters are temporarily stor
ed
. In Process To run in the same address space. In-process servers are load
ed
in the client’s address space because they are implement
ed
as DLLs. The main advantage of running in-process is that the system usually does not ne
ed
to perform a context switch. The disadvantage to running in-process is that DLL has access to the process address space and can potentially cause problems. Out of Process To run outside the calling processes address space. OL
ED
B providers can run in-process or out of process. When running out of process, they run under the context of DLLHOST.EXE. Memory Leak To reserve or commit memory and unintentionally not release it when it is no longer being us
ed
. A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads, and so on. Memory Concepts (X86 Address Space) Per Process Address Space Every process has its own private virtual address space. For 32-bit processes, that address space is 4 GB, bas
ed
on a 32-bit pointer. Each process’s virtual address space is split into user and system
partition
s bas
ed
on the underlying operating system. The diagram includ
ed
at the top represents the address
partition
ing for the 32-bit version of Windows 2000. Typically, the process address space is evenly divid
ed
into two 2-GB regions. Each process has access to 2 GB of the 4 GB address space. The upper 2 GB of address space is reserv
ed
for the system. The user address space is where appli
cat
ion code, global variables, per-thread stacks, and DLL code would reside. The system address space is where the kernel, executive, HAL, boot drivers, page tables, pool, and system cache reside. For specific information regarding address space layout, refer to Inside Microsoft Windows 2000 Third
Ed
ition pages 417-428 by Microsoft Press. Access Modes Each virtual memory address is tagg
ed
as to what access mode the processor must be running in. System space can only be access
ed
while in kernel mode, while user space is accessible in user mode. This protects system space from being tamper
ed
with by user mode code. Shar
ed
System Space Although every process has its own private memory space, kernel mode code and drivers share system space. Windows 2000 does not provide any protection to private memory being use by components running in kernel mode. As such, it is very important to ensure components running in kernel mode are thoroughly test
ed
. 3-GB Address Space 3-GB Address Space Although 2 GB of address space may seem like a large amount of memory, appli
cat
ion such as SQL Server could leverage more memory if it were available. The boot.ini option /3GB was creat
ed
for those cases where systems actually support greater than 2 GB of physical memory and an appli
cat
ion can make use of it This capability
allo
ws memory intensive appli
cat
ions running on Windows 2000 Advanc
ed
Server to use up to 50 percent more virtual memory on Intel-bas
ed
computers. Appli
cat
ion memory tuning provides more of the computer's virtual memory to appli
cat
ions by providing less virtual memory to the operating system. Although a system having less than 2 GB of physical memory can be boot
ed
using the /3G switch, in most cases this is ill-advis
ed
. If you restart with the 3 GB switch, also known as 4-Gig Tuning, the amount of non-pag
ed
pool is r
ed
uc
ed
to 128 MB from 256 MB. For a process to access 3 GB of address space, the executable image must have been link
ed
with the /LARGEADDRESSAWARE flag or modifi
ed
using Imagecfg.exe. It should be point
ed
out that SQL Server was link
ed
using the /LAREGEADDRESSAWARE flag and can leverage 3 GB when enabl
ed
. Note Even though you can boot Windows 2000 Professional or Windows 2000 Server with the /3GB boot option, users processes are still limit
ed
to 2 GB of address space even if the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is set in the image. The only thing accomplish
ed
by using the /3G option on these system is the r
ed
uction in the amount of address space available to the system (ISW2K Pg. 418). Important If you use /3GB in conjunction with AWE/PAE you are limit
ed
to 16 GB of memory. For more information, see the following Knowl
ed
ge Base articles: Q171793 Information on Appli
cat
ion Use of 4GT RAM Tuning Q126402 Pag
ed
PoolSize and NonPag
ed
PoolSize Values in Windows NT Q247904 How to Configure Pag
ed
Pool and System PTE Memory Areas Q274598 W2K Does Not Enable Complete Memory Dumps Between 2 & 4 GB AWE Memory Layout AWE Memory Usually, the operation system is limit
ed
to 4 GB of physical memory. However, by leveraging PAE, Windows 2000 Advanc
ed
Server can support up to 8 GB of memory, and Data Center 64 GB of memory. However, as stat
ed
previously, each 32-bit process normally has access to only 2 GB of address space, or 3 GB if the system was boot
ed
with the /3-GB option. To
allo
w processes to
allo
cat
e more physical memory than can be represent
ed
in the 2GB of address space, Microsoft creat
ed
the Address Windows Extensions (AWE). These extensions
allo
w for the
allo
cat
ion and use of up to the amount of physical memory support
ed
by the operating system. By leveraging the Address Windowing Extensions API, an appli
cat
ion can create a fix
ed
-size window into the physical memory. This
allo
ws a process to access any portion of the physical memory by mapping regions of physical memory in and out of the appli
cat
ions window. The
allo
cat
ion and use of AWE memory is accomplish
ed
by Creating a window via Virtual
Allo
c using the MEM_PHYSICAL option
Allo
cat
ing the physical pages through
Allo
cat
eUserPhysicalPages Mapping the RAM pages to the window using MapUserPhysicalPages Note SQL Server 7.0 supports a feature call
ed
extend
ed
memory in Windows NT® 4 Enterprise
Ed
ition by using a PSE36 driver. Currently there are no PSE drivers for Windows 2000. The preferr
ed
method of accessing extend
ed
memory is via the Physical Addressing Extensions using AWE. The AWE mapping feature is much more efficient than the older process of coping buffers from extend
ed
memory into the process address space. Unfortunately, SQL Server 7.0 cannot leverage PAE/AWE. Because there are currently no PSE36 drivers for Windows 2000 this means SQL Server 7.0 cannot support more than 3GB of memory on Windows 2000. Refer to KB article Q278466. AWE restrictions The process must have Lock Pages In Memory user rights to use AWE Important It is important that you use Enterprise Manager or DMO to change the service account. Enterprise Manager and DMO will grant all of the privileges and Registry and file permissions ne
ed
ed
for SQL Server. The Service Control Panel does NOT grant all the rights or permissions ne
ed
ed
to run SQL Server. Pages are not shareable or page-able Page protection is limit
ed
to read/write The same physical page cannot be mapp
ed
into two separate AWE regions, even within the same process. The use of AWE/PAE in conjunction with /3GB will limit the maximum amount of support
ed
memory to between 12-16 GB of memory. Task manager does not show the correct amount of memory
allo
cat
ed
to AWE-enabl
ed
appli
cat
ions. You must use Memory Manager: Total Server Memory. It should, however, be not
ed
that this only shows memory in use by the buffer pool. Machines that have PAE enabl
ed
will not dump user mode memory. If an event occurs in User Mode Memory that causes a blue screen and root cause determination is absolutely necessary, the machine must be boot
ed
with the /NOPAE switch, and with /MAXMEM set to a number appropriate for transferring dump files. With AWE enabl
ed
, SQL Server will, by default,
allo
cat
e almost all memory during startup, leaving 256 MB or less free. This memory is lock
ed
and cannot be pag
ed
out. Consuming all available memory may prevent other appli
cat
ions or SQL Server instances from starting. Note PAE is not requir
ed
to leverage AWE. However, if you have more than 4GB of physical memory you will not be able to access it unless you enable PAE. Caution It is highly recommend
ed
that you use the “max server memory” option in combination with “awe enabl
ed
” to ensure some memory headroom exists for other appli
cat
ions or instances of SQL Server, because AWE memory cannot be shar
ed
or pag
ed
. For more information, see the following Knowl
ed
ge Base articles: Q268363 Intel Physical Addressing Extensions (PAE) in Windows 2000 Q241046 Cannot Create a dump File on Computers with over 4 GB RAM Q255600 Windows 2000 utilities do not display physical memory above 4GB Q274750 How to configure SQL Server memory more than 2 GB (Idea) Q266251 Memory dump stalls when PAE option is enabl
ed
(Idea) Tip The KB will return more hits if you query on PAE rather than AWE. Virtual Address Space Mapping Virtual Address Space Mapping By default Windows 2000 (on an X86 platform) uses a two-level (three-level when PAE is enabl
ed
) page table structure to translate virtual addresses to physical addresses. Each 32-bit address has three components, as shown below. When a process accesses a virtual address the system must first lo
cat
e the Page Directory for the current process via register CR3 (X86). The first 10 bits of the virtual address act as an index into the Page Directory. The Page Directory Entry then points to the Page Frame Number (PFN) of the appropriate Page Table. The next 10 bits of the virtual address act as an index into the Page Table to lo
cat
e the appropriate page. If the page is valid, the PTE contains the PFN of the actual page in memory. If the page is not valid, the memory management fault handler lo
cat
es the page and attempts to make it valid. The final 12 bits act as a byte offset into the page. Note This multi-step process is expensive. This is why systems have translation look aside buffers (TLB) to spe
ed
up the process. One of the reasons context switching is so expensive is the translation buffers must be dump
ed
. Thus, the first few lookups are very expensive. Refer to ISW2K pages 439-440. Core System Memory Relat
ed
Counters Core System Memory Relat
ed
Counters When evaluating memory performance you are looking at a wide variety of counters. The counters list
ed
here are a few of the core counters that give you quick overall view of the state of memory. The two key counters are Available Bytes and Committ
ed
Bytes. If Committ
ed
Bytes exce
ed
s the amount of physical memory in the system, you can be assur
ed
that there is some level of hard page fault activity happening. The goal of a well-tun
ed
system is to have as little hard paging as possible. If Available Bytes is below 5 MB, you should investigate why. If Available Bytes is below 4 MB, the Working Set Manager will start to aggressively trim the working sets of process including the system cache. Committ
ed
Bytes Total memory, including physical and page file currently committ
ed
Commit Limit • Physical memory + page file size • Represents the total amount of memory that can be committ
ed
without expanding the page file. (Assuming page file is
allo
w
ed
to grow) Available Bytes Total physical memory currently available Note Available Bytes is a key indi
cat
or of the amount of memory pressure. Windows 2000 will attempt to keep this above approximately 4 MB by aggressively trimming the working sets including system cache. If this value is constantly between 3-4 MB, it is cause for investigation. One counter you might expect would be for total physical memory. Unfortunately, there is no specific counter for total physical memory. There are however many other ways to determine total physical memory. One of the most common is by viewing the Performance tab of Task Manager. Page File Usage The only counters that show current page file space usage are Page File:% Usage and Page File:% Peak Usage. These two counters will give you an indi
cat
ion of the amount of space currently us
ed
in the page file. Memory Performance Memory Counters There are a number of counters that you ne
ed
to investigate when evaluating memory performance. As stat
ed
previously, no single counter provides the entire picture. You will ne
ed
to consider many different counters to begin to understand the true state of memory. Note The counters list
ed
are a subset of the counters you should capture. *Available Bytes In general, it is desirable to see Available Bytes above 5 MB. SQL Servers goal on Intel platforms, running Windows NT, is to assure there is approximately 5+ MB of free memory. After Available Bytes reaches 4 MB, the Working Set Manager will start to aggressively trim the working sets of process and, finally, the system cache. This is not to say that working set trimming does not happen before 4 MB, but it does become more pronounc
ed
as the number of available bytes decreases below 4 MB. Page Faults/sec Page Faults/sec represents the total number of hard and soft page faults. This value includes the System Working Set as well. Keep this in mind when evaluating the amount of paging activity in the system. Because this counter includes paging associat
ed
with the System Cache, a server acting as a file server may have a much higher value than a d
ed
i
cat
ed
SQL Server may have. The System Working Set is cover
ed
in depth on the next slide. Because Page Faults/sec includes soft faults, this counter is not as useful as Pages/sec, which represents hard page faults. Because of the associat
ed
I/O, hard page faults tend to be much more expensive. *Pages/sec Pages/sec represent the number of pages written/read from disk because of hard page faults. It is the sum of Memory: Pages Input/sec and Memory: Pages Output/sec. Because it is count
ed
in numbers of pages, it can be compar
ed
to other counts of pages, such as Memory: Page Faults/sec, without conversion. On a well-tun
ed
system, this value should be consistently low. In and of itself, a high value for this counter does not necessarily indi
cat
e a problem. You will ne
ed
to isolate the paging activity to determine if it is associat
ed
with in-paging, out-paging, memory mapp
ed
file activity or system cache. Any one of these activities will contribute to this counter. Note Paging in and of itself is not necessarily a bad thing. Paging is only “bad” when a critical process must wait for it’s pages to be in-pag
ed
, or when the amount of read/write paging is causing excessive kernel time or disk I/O, thus interfering with normal user mode processing. Tip (Memory: Pages/sec) / (PhysicalDisk: Disk Bytes/sec * 4096) yields the approximate percentage of paging to total disk I/O. Note, this is only relevant on X86 platforms with a 4 KB page size. Page Reads/sec (Hard Page Fault) Page Reads/sec is the number of times the disk was access
ed
to resolve hard page faults. It includes reads to satisfy faults in the file system cache (usually
request
ed
by appli
cat
ions) and in non-cach
ed
memory mapp
ed
files. This counter counts numbers of read operations, without regard to the numbers of pages retriev
ed
by each operation. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. Page Writes/sec (Hard Page Fault) Page Writes/sec is the number of times pages were written to disk to free up space in physical memory. Pages are written to disk only if they are chang
ed
while in physical memory, so they are likely to hold data, not code. This counter counts write operations, without regard to the number of pages written in each operation. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. *Pages Input/sec (Hard Page Fault) Pages Input/sec is the number of pages read from disk to resolve hard page faults. It includes pages retriev
ed
to satisfy faults in the file system cache and in non-cach
ed
memory mapp
ed
files. This counter counts numbers of pages, and can be compar
ed
to other counts of pages, such as Memory:Page Faults/sec, without conversion. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. This is one of the key counters to monitor for potential performance complaints. Because a process must wait for a read page fault this counter, read page faults have a direct impact on the perceiv
ed
performance of a process. *Pages Output/sec (Hard Page Fault) Pages Output/sec is the number of pages written to disk to free up space in physical memory. Pages are written back to disk only if they are chang
ed
in physical memory, so they are likely to hold data, not code. A high rate of pages output might indi
cat
e a memory shortage. Windows NT writes more pages back to disk to free up space when physical memory is in short supply. This counter counts numbers of pages, and can be compar
ed
to other counts of pages, without conversion. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. Like Pages Input/sec, this is one of the key counters to monitor. Processes will generally not notice write page faults unless the disk I/O begins to interfere with normal data operations. Demand Zero Faults/Sec (Soft Page Fault) Demand Zero Faults/sec is the number of page faults that require a zero
ed
page to satisfy the fault. Zero
ed
pages, pages empti
ed
of previously stor
ed
data and fill
ed
with zeros, are a security feature of Windows NT. Windows NT maintains a list of zero
ed
pages to accelerate this process. This counter counts numbers of faults, without regard to the numbers of pages retriev
ed
to satisfy the fault. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. Transition Faults/Sec (Soft Page Fault) Transition Faults/sec is the number of page faults resolv
ed
by recovering pages that were on the modifi
ed
page list, on the standby list, or being written to disk at the time of the page fault. The pages were recover
ed
without additional disk activity. Transition faults are count
ed
in numbers of faults, without regard for the number of pages fault
ed
in each operation. This counter displays the difference between the values observ
ed
in the last two samples, divid
ed
by the duration of the sample interval. System Working Set System Working Set Like processes, the system page-able code and data are manag
ed
by a working set. For the purpose of this course, that working set is referr
ed
to as the System Working Set. This is done to differentiate the system cache portion of the working set from the entire working set. There are five different types of pages that make up the System Working Set. They are: system cache; pag
ed
pool; page-able code and data in ntoskrnl.exe; page-able code, and data in device drivers and system-mapp
ed
views. Unfortunately, some of the counters that appear to represent the system cache actually represent the entire system working set. Where not
ed
system cache actually represents the entire system working set. Note The counters list
ed
are a subset of the counters you should capture. *Memory: Cache Bytes (Represents Total System Working Set) Represents the total size of the System Working Set including: system cache; pag
ed
pool; pageable code and data in ntoskrnl.exe; pageable code and data in device drivers; and system-mapp
ed
views. Cache Bytes is the sum of the following counters: System Cache Resident Bytes, System Driver Resident Bytes, System Code Resident Bytes, and Pool Pag
ed
Resident Bytes. Memory: System Cache Resident Bytes (System Cache) System Cache Resident Bytes is the number of bytes from the file system cache that are resident in physical memory. Windows 2000 Cache Manager works with the memory manager to provide virtual block stream and file data caching. For more information, see also…Inside Windows 2000,Third
Ed
ition, pp. 645-650 and p. 656. Memory: Pool Pag
ed
Resident Bytes Represents the physical memory consum
ed
by Pag
ed
Pool. This counter should NOT be monitor
ed
by itself. You must also monitor Memory: Pag
ed
Pool. A leak in the pool may not show up in Pool pag
ed
Resident Bytes. Memory: System Driver Resident Bytes Represents the physical memory consum
ed
by driver code and data. System Driver Resident Bytes and System Driver Total Bytes do not include code that must remain in physical memory and cannot be written to disk. Memory: System Code Resident Bytes Represents the physical memory consum
ed
by page-able system code. System Code Resident Bytes and System Code Total Bytes do not include code that must remain in physical memory and cannot be written to disk. Working Set Performance Counter You can measure the number of page faults in the System Working Set by monitoring the Memory: Cache Faults/sec counter. Contrary to the “Explain” shown in System Monitor, this counter measures the total amount of page faults/sec in the System Working Set, not only the System Cache. You cannot measure the performance of the System Cache using this counter alone. For more information, see also…Inside Windows 2000,Third
Ed
ition, p. 656. Note You will find that in general the working set manager will usually trim the working sets of normal processes prior to trimming the system working set. System Cache System Cache The Windows 2000 cache manager provides a write-back cache with lazy writing and intelligent read-ahead. Files are not written to disk imm
ed
iately but differ
ed
until the cache manager calls the memory manager to flush the cache. This helps to r
ed
uce the total number of I/Os. Once per second, the lazy writer thread queues one-eighth of the dirty pages in the system cache to be written to disk. If this is not sufficient to meet the ne
ed
s, the lazy writer will calculate a larger value. If the dirty page threshold is exce
ed
ed
prior to lazy writer waking, the cache manager will wake the lazy writer. Important It should be point
ed
out that mapp
ed
files or files open
ed
with FILE_FLAG_NO_BUFFERING, do not participate in the System Cache. For more information regarding mapp
ed
views, see also…Inside Windows 2000,Third
Ed
ition, p. 669. For those appli
cat
ions that would like to leverage system cache but cannot tolerate write delays, the cache manager supports write through operations via the FILE_FLAG_WRITE_THROUGH. On the other hand, an appli
cat
ion can disable lazy writing by using the FILE_ATTRIBUTE_TEMPORARY. If this flag is enabl
ed
, the lazy writer will not write the pages to disk unless there is a shortage of memory or the file is clos
ed
. Important Microsoft SQL Server uses both FILE_FLAG_NO_BUFFERING and FILE_FLAG_WRITE_THROUGH Tip The file system cache is not represent
ed
by a static amount of memory. The system cache can and will grow. It is not unusual to see the system cache consume a large amount of memory. Like other working sets, it is trimm
ed
under pressure but is generally the last thing to be trimm
ed
. System Cache Performance Counters The counters list
ed
are a subset of the counters you should capture. Cache: Data Flushes/sec Data Flushes/sec is the rate at which the file system cache has flush
ed
its contents to disk as the result of a
request
to flush or to satisfy a write-through file write
request
. More than one page can be transferr
ed
on each flush operation. Cache: Data Flush Pages/sec Data Flush Pages/sec is the number of pages the file system cache has flush
ed
to disk as a result of a
request
to flush or to satisfy a write-through file write
request
. Cache: Lazy Write Flushes/sec Represents the rate of lazy writes to flush the system cache per second. More than one page can be transferr
ed
per second. Cache: Lazy Write Pages/sec Lazy Write Pages/sec is the rate at which the Lazy Writer thread has written to disk. Note When looking at Memory:Cache Faults/sec, you can remove cache write activity by subtracting (Cache: Data Flush Pages/sec + Cache: Lazy Write Pages/sec). This will give you a better idea of how much other page faulting activity is associat
ed
with the other components of the System Working Set. However, you should note that there is no easy way to remove the page faults associat
ed
with file cache read activity. For more information, see the following Knowl
ed
ge Base articles: Q145952 (NT4) Event ID 26 Appears If Large File Transfer Fails Q163401 (NT4) How to Disable Network R
ed
irector File Caching Q181073 (SQL 6.5) DUMP May Cause Access Violation on Win2000 System Pool System Pool As document
ed
earlier, there are two types of shar
ed
pool memory: non-pag
ed
pool and pag
ed
pool. Like private memory, pool memory is susceptible to a leak. Nonpag
ed
Pool Miscellaneous kernel code and structures, and drivers that ne
ed
working memory while at or above DPC/dispatch level use non-pag
ed
pool. The primary counter for non-pag
ed
pool is Memory: Pool Nonpag
ed
Bytes. This counter will usually between 3 and 30 MB. Pag
ed
Pool Drivers that do not ne
ed
to access memory above DPC/Dispatch level are one of the primary users of pag
ed
pool, however any process can use pag
ed
pool by leveraging the Ex
Allo
cat
ePool calls. Pag
ed
pool also contains the Registry and file and printing structures. The primary counters for monitoring pag
ed
pool is Memory: Pool Pag
ed
Bytes. This counter will usually be between 10-30MB plus the size of the Registry. To determine how much of pag
ed
pool is currently resident in physical memory, monitor Memory: Pool Pag
ed
Resident Bytes. Note The pag
ed
and non-pag
ed
pools are two of the components of the System Working Set. If a suspect
ed
leak is clearly visible in the overview and not associat
ed
with a process, then it is most likely a pool leak. If the leak is not associat
ed
with SQL Server handles, OLDEB providers, XPROCS or SP_OA calls then most likely this call should be push
ed
to the Windows NT group. For more information, see the following Knowl
ed
ge Base articles: Q265028 (MS) Pool Tags Q258793 (MS) How to Find Memory Leaks by Using Pool Bitmap Analysis Q115280 (MS) Finding Windows NT Kernel Mode Memory Leaks Q177415 (MS) How to Use Poolmon to Troubleshoot Kernel Mode Memory Leaks Q126402 Pag
ed
PoolSize and NonPag
ed
PoolSize Values in Windows NT Q247904 How to Configure Pag
ed
Pool and System PTE Memory Areas Tip To isolate pool leaks you will ne
ed
to isolate all drivers and third-party processes. This should be done by disabling each service or driver one at a time and monitoring the effect. You can also monitor pag
ed
and non-pag
ed
pool through poolmon. If pool tagging has been enabl
ed
via GFLAGS, you may be able to associate the leak to a particular tag. If you suspect a particular tag, you should involve the platform support group. Process Memory Counters Process _Total Limitations Although the rollup of _Total for Process: Private Bytes, Virtual Bytes, Handles and Threads, represent the key resources being us
ed
across all processes, they can be misleading when evaluating a memory leak. This is because a leak in one process may be mask
ed
by a decrease in another process. Note The counters list
ed
are a subset of the counters you should capture. Tip When analyzing memory leaks, it is often easier to a build either a separate chart or report showing only one or two key counters for all process. The primary counter us
ed
for leak analysis is private bytes, but processes can leak handles and threads just as easily. After a suspect process is lo
cat
ed
, build a separate chart that includes all the counters for that process. Individual Process Counters When analyzing individual process for memory leaks you should include the counters list
ed
. Process: % Processor Time Process: Working Set (includes shar
ed
pages) Process: Virtual Bytes Process: Private Bytes Process: Page Faults/sec Process: Handle Count Process: Thread Count Process: Pool Pag
ed
Bytes Process: Pool Nonpag
ed
Bytes Tip WINLOGON, SVCHOST, services, or SPOOLSV are referr
ed
to as HELPER processes. They provide core functionality for many operations and as such are often extend
ed
by the addition of third-party DLLs. Tlist –s may help identify what services are running under a particular helper. Helper Processes Helper Processes Winlogon, Services, and Spoolsv and Svchost are examples of what are referr
ed
to as HELPER processes. They provide core functionality for many operations and, as such, are often extend
ed
by the addition of third-party DLLs. Running every service in its own process can waste system resources. Consequently, some services run in their own processes while others share a process with other services. One problem with sharing a process is that a bug in one service may cause the entire process to fail. The resource kit tool, Tlist when us
ed
with the –s qualifier can help you identify what services are running in what processes. WINLOGON Us
ed
to support GINAs. SPOOLSV SPOOLSV is responsible for printing. You will ne
ed
to investigate all add
ed
printing functionality. Services Service is responsible for system services. Svchost.exe Svchost.exe is a generic host process name for services that are run from dynamic-link libraries (DLLs). There can be multiple instances of Svchost.exe running at the same time. Each Svchost.exe session can contain a grouping of services, so that separate services can be run depending on how and where Svchost.exe is start
ed
. This
allo
ws for better control and debugging. The Effect of Memory on Other Components Memory Drives Overall Performance Processor, cache, bus spe
ed
s, I/O, all of these resources play a roll in overall perceiv
ed
performance. Without minimizing the impact of these components, it is important to point out that a shortage of memory can often have a larger perceiv
ed
impact on performance than a shortage of some other resource. On the other hand, an abundance of memory can often be leverag
ed
to mask bottlenecks. For instance, in certain environments, file system cache can significantly r
ed
uce the amount of disk I/O, potentially masking a slow I/O subsystem. Effect on I/O I/O can be driven by a number of memory considerations. Page read/faults will cause a read I/O when a page is not in memory. If the modifi
ed
page list becomes too long the Modifi
ed
Page Writer and Mapp
ed
Page Writer will ne
ed
to start flushing pages causing disk writes. However, the one event that can have the greatest impact is running low on available memory. In this case, all of the above events will become more pronounc
ed
and have a larger impact on disk activity. Effect on CPU The most effective use of a processor from a process perspective is to spend as much time possible executing user mode code. Kernel mode represents processor time associat
ed
with doing work, directly or indirectly, on behalf of a thread. This includes items such as synchronization, sch
ed
uling, I/O, memory management, and so on. Although this work is essential, it takes processor cycles and the cost, in cycles, to transition between user and kernel mode is expensive. Because all memory management and I/O functions must be done in kernel mode, it follows that the fewer the memory resources the more cycles are going to be spent managing those resources. A direct result of low memory is that the Working Set Manager, Modifi
ed
Page Writer and Mapp
ed
Page Writer will have to use more cycles attempting to free memory. Analyzing Memory Look for Trends and Trend Relationships Troubleshooting performance is about analyzing trends and trend relationships. Establishing that some event happen
ed
is not enough. You must establish the effect of the event. For example, you note that paging activity is high at the same time that SQL Server becomes slow. These two individual facts may or may not be relat
ed
. If the paging is not associat
ed
with SQL Servers working set, or the disks SQL is using there may be little or no cause/affect relationship. Look at Physical Memory First The first item to look at is physical memory. You ne
ed
to know how much physical and page file space the system has to work with. You should then evaluate how much available memory there is. Just because the system has free memory does not mean that there is not any memory pressure. Available Bytes in combination with Pages Input/sec and Pages Output/sec can be a good indi
cat
or as to the amount of pressure. The goal in a perfect world is to have as little hard paging activity as possible with available memory greater than 5 MB. This is not to say that paging is bad. On the contrary, paging is a very effective way to manage a limit
ed
resource. Again, we are looking for trends that we can use to establish relationships. After evaluating physical memory, you should be able to answer the following questions: How much physical memory do I have? What is the commit limit? Of that physical memory, how much has the operating system committ
ed
? Is the operating system over committing physical memory? What was the peak commit charge? How much available physical memory is there? What is the trend associat
ed
with committ
ed
and available? Review System Cache and Pool Contribution After you understand the individual process memory usage, you ne
ed
to evaluate the System Cache and Pool usage. These can and often represent a significant portion of physical memory. Be aware that System Cache can grow significantly on a file server. This is usually normal. One thing to consider is that the file system cache tends to be the last thing trimm
ed
when memory becomes low. If you see abrupt decreases in System Cache Resident Bytes when Available Bytes is below 5 MB you can be assur
ed
that the system is experiencing excessive memory pressure. Pag
ed
and non-pag
ed
pool size is also important to consider. An ever-increasing pool should be an indi
cat
or for further research. Non-pag
ed
pool growth is usually a driver issue, while pag
ed
pool could be driver-relat
ed
or process-relat
ed
. If pag
ed
pool is steadily growing, you should investigate each process to see if there is a specific process relationship. If not you will have to use tools such as poolmon to investigate further. Review Process Memory Usage After you understand the physical memory limitations and cache and pool contribution you ne
ed
to determine what components or processes are creating the pressure on memory, if any. Be careful if you opt to chart the _Total Private Byte’s rollup for all processes. This value can be misleading in that it includes shar
ed
pages and can therefore exce
ed
the actual amount of memory being us
ed
by the processes. The _Total rollup can also mask processes that are leaking memory because other processes may be freeing memory thus creating a balance between leak
ed
and fre
ed
memory. Identify processes that expand their working set over time for further analysis. Also, review handles and threads because both use resources and potentially can be mismanag
ed
. After evaluating the process resource usage, you should be able to answer the following: Are any of the processes increasing their private bytes over time? Are any processes growing their working set over time? Are any processes increasing the number of threads or handles over time? Are any processes increasing their use of pool over time? Is there a direct relationship between the above nam
ed
resources and total committ
ed
memory or available memory? If there is a relationship, is this normal behavior for the process in question? For example, SQL does not commit ‘min memory’ on startup; these pages are fault
ed
in into the working set as ne
ed
ed
. This is not necessarily an indi
cat
ion of a memory leak. If there is clearly a leak in the overview and is not identifiable in the process counters it is most likely in the pool. If the leak in pool is not associat
ed
with SQL Server handles, then more often than not, it is not a SQL Server issue. There is however the possibility that the leak could be associat
ed
with third party XPROCS, SP_OA* calls or OLDB providers. Review Paging Activity and Its Impact on CPU and I/O As stat
ed
earlier, paging is not in and of itself a bad thing. When starting a process the system faults in the pages of an executable, as they are ne
ed
ed
. This is preferable to loading the entire image at startup. The same can be said for memory mapp
ed
files and file system cache. All of these features leverage the ability of the system to fault in pages as ne
ed
ed
The greatest impact of paging on a process is when the process must wait for an in-page fault or when page file activity represents a significant portion of the disk activity on the disk the appli
cat
ion is actively using. After evaluating page fault activity, you should be able to answer the following questions: What is the relationship between PageFaults/sec and Page Input/sec + Page Output/Sec? What is the relationship if any between hard page faults and available memory? Does paging activity represent a significant portion of processor or I/O resource usage? Don’t Prematurely Jump to Any Conclusions Analyzing memory pressure takes time and patience. An individual counter in and of it self means little. It is only when you start to explore relationships between cause and effect that you can begin to understand the impact of a particular counter. The key thoughts to remember are: With the exception of a swap (when the entire process’s working set has been swapp
ed
out/in), hard page faults to resolve reads, are the most expensive in terms its effect on a processes perceiv
ed
performance. In general, page writes associat
ed
with page faults do not directly affect a process’s perceiv
ed
performance, unless that process is waiting on a free page to be made available. Page file activity can become a problem if that activity competes for a significant percentage of the disk throughput in a heavy I/O orientat
ed
environment. That assumes of course that the page file resides on the same disk the appli
cat
ion is using. Lab 3.1 System Memory Lab 3.1 Analyzing System Memory Using System Monitor Exercise 1 – Troubleshooting the Cardinal1.log File Students will evaluate an existing System Monitor log and determine if there is a problem and what the problem is. Students should be able to isolate the issue as a memory problem, lo
cat
e the offending process, and determine whether or not this is a pool issue. Exercise 2 – Leakyapp Behavior Students will start leaky app and monitor memory, page file and cache counters to better understand the dynamics of these counters. Exercise 3 – Process Swap Due To Minimizing of the Cmd Window Students will start SQL from command line while viewing SQL process performance counters. Students will then minimize the window and note the effect on the working set. Overview What You Will Learn After completing this lab, you will be able to: Use some of the basic functions within System Monitor. Troubleshoot one or more common performance scenarios. Before You Begin Prerequisites To complete this lab, you ne
ed
the following: Windows 2000 SQL Server 2000 Lab Files Provid
ed
LeakyApp.exe (Resource Kit) Estimat
ed
time to complete this lab: 45 minutes Exercise 1 Troubleshooting the Cardinal1.log File In this exercise, you will analyze a log file from an actual system that was having performance problems. Like an actual support engineer, you will not have much information from which to draw conclusions. The customer has sent you this log file and it is up to you to find the cause of the problem. However, unlike the real world, you have an instructor available to give you hints should you become stuck. Goal Review the Cardinal1.log file (this file is from Windows NT 4.0 Performance Monitor, which Windows 2000 can read). Chart the log file and begin to investigate the counters to determine what is causing the performance problems. Your goal should be to isolate the problem to a major area such as pool, virtual address space etc, and begin to isolate the problem to a specific process or thread. This lab requires access to the log file Cardinal1.log lo
cat
ed
in C:\LABS\M3\LAB1\EX1 To analyze the log file 1. Using the Performance MMC, select the System Monitor snap-in, and click the View Log File Data button (icon looks like a disk). 2. Under Files of type, choose PERFMON Log Files (*.log) 3. Navigate to the folder containing Cardinal1.log file and open it. 4. Begin examining counters to find what might be causing the performance problems. When examining some of these counters, you may notice that some of them go off the top of the chart. It may be necessary to adjust the scale on these. This can be done by right-clicking the rightmost pane and selecting Properties. Select the Data tab. Select the counter that you wish to modify. Under the Scale option, change the scale value, which makes the counter data visible on the chart. You may ne
ed
to experiment with different scale values before finding the ideal value. Also, it may sometimes be beneficial to adjust the vertical scale for the entire chart. Selecting the Graph tab on the Properties page can do this. In the Vertical scale area, adjust the Maximum and Minimum values to best fit the data on the chart. Lab 3.1, Exercise 1: Results Exercise 2 LeakyApp Behavior In this lab, you will have an opportunity to work with a partner to monitor a live system, which is suffering from a simulat
ed
memory leak. Goal During this lab, your goal is to observe the system behavior when memory starts to become a limit
ed
resource. Specifically you will want to monitor committ
ed
memory, available memory, the system working set including the file system cache and each processes working set. At the end of the lab, you should be able to provide an answer to the list
ed
questions. To monitor a live system with a memory leak 1. Choose one of the two systems as a victim on which to run the leakyapp.exe program. It is recommend
ed
that you boot using the \MAXMEM=128 option so that this lab goes a little faster. You and your partner should decide which server will play the role of the problematic server and which server is to be us
ed
for monitoring purposes. 2. On the problematic server, start the leakyapp program. 3. On the monitoring system, create a counter that logs all necessary counters ne
ed
to troubleshoot a memory problem. This should include physicaldisk counters if you think paging is a problem. Because it is likely that you will only ne
ed
to capture less than five minutes of activity, the suggest
ed
interval for capturing is five seconds. 4. After the counters have been start
ed
, start the leaky appli
cat
ion program 5. Click Start Leaking. The button will now change to Stop Leaking, which indi
cat
es that the system is now leaking memory. 6. After leakyapp shows the page file is 50 percent full, click Stop leaking. Note that the process has not given back its memory, yet. After approximately one minute, exit. Lab 3.1, Exercise 2: Questions After analyzing the counter logs you should be able to answer the following: 1. Under which system memory counter does the leak show up clearly? Memory:Committ
ed
Bytes 2. What process counter look
ed
very similar to the overall system counter that show
ed
the leak? Private Bytes 3. Is the leak in Pag
ed
Pool, Non-pag
ed
pool, or elsewhere? Elsewhere 4. At what point did Windows 2000 start to aggressively trim the working sets of all user processes? <5 MB Free 5. Was the System Working Set trimm
ed
before or after the working sets of other processes? After 6. What counter show
ed
this? Memory:Cache Bytes 7. At what point was the File System Cache trimm
ed
? After the first pass through all other working sets 8. What was the effect on all the processes working set when the appli
cat
ion quit leaking? None 9. What was the effect on all the working sets when the appli
cat
ion exit
ed
? Nothing, initially; but all grew fairly quickly bas
ed
on use 10. When the server was running low on memory, which was Windows spending more time doing, paging to disk or in-paging? Paging to disk, initially; however, as other appli
cat
ions began to run, in-paging increas
ed
Exercise 3 Minimizing a Command Window In this exercise, you will have an opportunity to observe the behavior of Windows 2000 when a command window is minimiz
ed
. Goal During this lab, your goal is to observe the behavior of Windows 2000 when a command window becomes minimiz
ed
. Specifically, you will want to monitor private bytes, virtual bytes, and working set of SQL Server when the command window is minimiz
ed
. At the end of the lab, you should be able to provide an answer to the list
ed
questions. To monitor a command window’s working set as the window is minimiz
ed
1. Using System Monitor, create a counter list that logs all necessary counters ne
ed
ed
to troubleshoot a memory problem. Because it is likely that you will only ne
ed
to capture less than five minutes of activity, the suggest
ed
capturing interval is five seconds. 2. After the counters have been start
ed
, start a Command Prompt window on the target system. 3. In the command window, start SQL Server from the command line. Example: SQL Servr.exe –c –sINSTANCE1 4. After SQL Server has successfully start
ed
, Minimize the Command Prompt window. 5. Wait approximately two minutes, and then Restore the window. 6. Wait approximately two minutes, and then stop the counter log. Lab 3.1, Exercise 3: Questions After analyzing the counter logs you should be able to answer the following questions: 1. What was the effect on SQL Servers private bytes, virtual bytes, and working set when the window was minimiz
ed
? Private Bytes and Virtual Bytes remain
ed
the same, while Working Set went to 0 2. What was the effect on SQL Servers private bytes, virtual bytes, and working set when the window was restor
ed
? None; the Working Set did not grow until SQL access
ed
the pages and fault
ed
them back in on an as-ne
ed
ed
basis SQL Server Memory Overview SQL Server Memory Overview Now that you have a better understanding of how Windows 2000 manages memory resources, you can take a closer look at how SQL Server 2000 manages its memory. During the course of the lecture and labs you will have the opportunity to monitor SQL Servers use of memory under varying conditions using both System Monitor counters and SQL Server tools. SQL Server Memory Management Goals Because SQL Server has in-depth knowl
ed
ge about the relationships between data and the pages they reside on, it is in a better position to judge when and what pages should be brought into memory, how many pages should be brought in at a time, and how long they should be resident. SQL Servers primary goals for management of its memory are the following: Be able to dynamically adjust for varying amounts of available memory. Be able to respond to outside memory pressure from other appli
cat
ions. Be able to adjust memory dynamically for internal components. Items Cover
ed
SQL Server Memory Definitions SQL Server Memory Layout SQL Server Memory Counters Memory Configurations Options Buffer Pool Performance and Counters Set Aside Memory and Counters General Troubleshooting Process Memory Myths and Tips SQL Server Memory Definitions SQL Server Memory Definitions Pool A group of resources, objects, or logical components that can service a resource
allo
cat
ion
request
Cache The management of a pool or resource, the primary goal of which is to increase performance. Bpool The Bpool (Buffer Pool) is a single static class instance. The Bpool is made up of 8-KB buffers and can be us
ed
to handle data pages or external memory
request
s. There are three basic types or
cat
egories of committ
ed
memory in the Bpool. Hash
ed
Data Pages Committ
ed
Buffers on the Free List Buffers known by their owners (Refer to definition of Stolen) Consumer A consumer is a subsystem that uses the Bpool. A consumer can also be a provider to other consumers. There are five consumers and two advanc
ed
consumers who are responsible for the different
cat
egories of memory. The following list represents the consumers and a partial list of their
cat
egories Connection – Responsible for PSS and ODS memory
allo
cat
ions General – Resource structures, parse headers, lock manager objects Utilities – Recovery, Log Manager Optimizer – Query Optimization Query Plan – Query Plan Storage Advanc
ed
Consumer Along with the five consumers, there are two advanc
ed
consumers. They are Ccache – Proc
ed
ure cache. Accepts plans from the Optimizer and Query Plan consumers. Is responsible for managing that memory and determines when to release the memory back to the Bpool. Log Cache – Manag
ed
by the LogMgr, which uses the Utility consumer to coordinate memory
request
s with the Bpool. Reservation
Request
ing the future use of a resource. A reservation is a reasonable guarantee that the resource will be available in the future. Committ
ed
Producing the physical resource
Allo
cat
ion The act of providing the resource to a consumer Stolen The act of getting a buffer from the Bpool is referr
ed
to as stealing a buffer. If the buffer is stolen and hash
ed
for a data page, it is referr
ed
to as, and count
ed
as, a Hash
ed
buffer, not a stolen buffer. Stolen buffers on the other hand are buffers us
ed
for things such as proc
ed
ure cache and SRV_PROC structures. Target Target memory is the amount of memory SQL Server would like to maintain as committ
ed
memory. Target memory is bas
ed
on the min and max server configuration values and current available memory as report
ed
by the operating system. Actual target calculation is operating system specific. Memory to Leave (Set Aside) The virtual address space set aside to ensure there is sufficient address space for thread stacks, XPROCS, COM objects etc. Hash
ed
Page A page in pool that represents a database page. SQL Server Memory Layout Virtual Address Space When SQL Server is start
ed
the minimum of physical ram or virtual address space support
ed
by the OS is evaluat
ed
. There are many possible combinations of OS versions and memory configurations. For example: you could be running Microsoft Windows 2000 Advanc
ed
Server with 2 GB or possibly 4 GB of memory. To avoid page file use, the appropriate memory level is evaluat
ed
for each configuration. Important Utilities can inject a DLL into the process address space by using HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs When the USER32.dll library is mapp
ed
into the process space, so, too, are the DLLs list
ed
in the Registry key. To determine what DLL’s are running in SQL Server address space you can use tlist.exe. You can also use a tool such as Depends from Microsoft or HandelEx from http://ww.sysinternals.com. Memory to Leave As stat
ed
earlier there are many possible configurations of physical memory and address space. It is possible for physical memory to be greater than virtual address space. To ensure that some virtual address space is always available for things such as thread stacks and external ne
ed
s such as XPROCS, SQL Server reserves a small portion of virtual address space prior to determining the size of the buffer pool. This address space is referr
ed
to as Memory To Leave. Its size is bas
ed
on the number of anticipat
ed
tread stacks and a default value for external ne
ed
s referr
ed
to as cmbAddressSave. After reserving the buffer pool space, the Memory To Leave reservation is releas
ed
. Buffer Pool Space During Startup, SQL Server must determine the maximum size of the buffer pool so that the BUF, BUFHASH and COMMIT BITMAP structures that are us
ed
to manage the Bpool can be creat
ed
. It is important to understand that SQL Server does not take ‘max memory’ or existing memory pressure into consideration. The reserv
ed
address space of the buffer pool remains static for the life of SQL Server process. However, the committ
ed
space varies as necessary to provide dynamic scaling. Remember only the committ
ed
memory effects the overall memory usage on the machine. This ensures that the max memory configuration setting can be dynamically chang
ed
with minimal changes ne
ed
ed
to the Bpool. The reserv
ed
space does not ne
ed
to be adjust
ed
and is maximiz
ed
for the current machine configuration. Only the committ
ed
buffers ne
ed
to be limit
ed
to maintain a specifi
ed
max server memory (MB) setting. SQL Server Startup Pseudo Code The following pseudo code represents the process SQL Server goes through on startup. Warning This example does not represent a completely accurate portrayal of the steps SQL Server takes when initializing the buffer pool. Several details have been left out or gloss
ed
over. The intent of this example is to help you understand the general process, not the specific details. Determine the size of cmbAddressSave (-g) Determine Total Physical Memory Determine Available Physical Memory Determine Total Virtual Memory Calculate MemToLeave maxworkterthreads * (stacksize=512 KB) + (cmbAddressSave = 256 MB) Reserve MemToLeave and set PAGE_NOACCESS Check for AWE, test to see if it makes sense to use it and log the results • Min(Available Memory, Max Server Memory) > Virtual Memory • Supports Read S
cat
ter • SQL Server not start
ed
with -f • AWE Enabl
ed
via sp_configure • Enterprise
Ed
ition • Lock Pages In Memory user right enabl
ed
Calculate Virtual Address Limit VA Limit = Min(Physical Memory, Virtual Memory – MemtoLeave) Calculate the number of physical and virtual buffers that can be support
ed
AWE Present Physical Buffers = (RAM / (PAGESIZE + Physical Overhead)) Virtual Buffers = (VA Limit / (PAGESIZE + Virtual Overhead)) AWE Not Present Physical Buffers = Virtual Buffers = VA Limit / (PAGESIZE + Physical Overhead + Virtual Overhead) Make sure we have the minimum number of buffers Physical Buffers = Max(Physical Buffers, MIN_BUFFERS)
Allo
cat
e and commit the buffer management structures Reserve the address space requir
ed
to support the Bpool buffers Release the MemToLeave SQL Server Startup Pseudo Code Example The following is an example bas
ed
on the pseudo code represent
ed
on the previous page. This example is bas
ed
on a machine with 384 MB of physical memory, not using AWE or /3GB. Note CmbAddressSave was chang
ed
between SQL Server 7.0 and SQL Server 2000. For SQL Server 7.0, cmbAddressSave was 128. Warning This example does not represent a completely accurate portrayal of the steps SQL Server takes when initializing the buffer pool. Several details have been left out or gloss
ed
over. The intent of this example is to help you understand the general process, not the specific details. Determine the size of cmbAddressSave (No –g so 256MB) Determine Total Physical Memory (384) Determine Available Physical Memory (384) Determine Total Virtual Memory (2GB) Calculate MemToLeave maxworkterthreads * (stacksize=512 KB) + (cmbAddressSave = 256 MB) (255 * .5MB + 256MB = 384MB) Reserve MemToLeave and set PAGE_NOACCESS Check for AWE, test to see if it makes sense to use it and log the results (AWE Not Enabl
ed
) Calculate Virtual Address Limit VA Limit = Min(Physical Memory, Virtual Memory – MemtoLeave) 384MB = Min(384MB, 2GB – 384MB) Calculate the number of physical and virtual buffers that can be support
ed
AWE Not Present 48664 (approx) = 384 MB / (8 KB + Overhead) Make sure we have the minimum number of buffers Physical Buffers = Max(Physical Buffers, MIN_BUFFERS) 48664 = Max(48664,1024)
Allo
cat
e and commit the buffer management structures Reserve the address space requir
ed
to support the Bpool buffers Release the MemToLeave Tip Trace Flag 1604 can be us
ed
to view memory
allo
cat
ions on startup. The cmbAddressSave can be adjust
ed
using the –g XXX startup parameter. SQL Server Memory Counters SQL Server Memory Counters The two primary tools for monitoring and analyzing SQL Server memory usage are System Monitor and DBCC MEMORYSTATUS. For detail
ed
information on DBCC MEMORYSTATUS refer to Q271624 Interpreting the Output of the DBCC MEMORYSTAUS Command. Important Represents SQL Server 2000 Counters. The counters present
ed
are not the same as the counters for SQL Server 7.0. The SQL Server 7.0 counters are list
ed
in the appendix. Determining Memory Usage for OS and BPOOL Memory Manager: Total Server memory (KB) - Represents all of SQL usage Buffer Manager: Total Pages - Represents total bpool usage To determine how much of Total Server Memory (KB) represents MemToLeave space; subtract Buffer Manager: Total Pages. The result can be verifi
ed
against DBCC MEMORYSTATUS, specifically Dynamic Memory Manager: OS In Use. It should however be not
ed
that this value only represents
request
s that went thru the bpool. Memory reserv
ed
outside of the bpool by components such as COM objects will not show up here, although they will count against SQL Server private byte count. Buffer Counts: Target (Buffer Manager: Target Pages) The size the buffer pool would like to be. If this value is larger than committ
ed
, the buffer pool is growing. Buffer Counts: Committ
ed
(Buffer Manager: Total Pages) The total number of buffers committ
ed
in the OS. This is the current size of the buffer pool. Buffer Counts: Min Free This is the number of pages that the buffer pool tries to keep on the free list. If the free list falls below this value, the buffer pool will attempt to populate it by discarding old pages from the data or proc
ed
ure cache. Buffer Distribution: Free (Buffer Manager / Buffer
Partition
: Free Pages) This value represents the buffers currently not in use. These are available for data or may be
request
ed
by other components and mar
联想安装linux出现“could not
allo
cat
e
request
ed
partition
s”
本人想在联想笔记本上装windows和linux双系统,原来电脑上有一个win7系统,在安装R
ed
Hat Enterprise Linux6.3到分区这一步骤时,选择“ /boot 格式为ext4 分区大小200M 勾上 强制为主分区的选项 ” 点击确认结果出现了could not
allo
cat
e
request
ed
partition
s的字样,后来多次尝试发现给“/”,"swa
CENT OS安装时出现无法选择磁盘的情况-清除raid磁盘信息
系统PXE安装Linux系统时出现的问题:Could not
allo
cat
e
request
ed
partition
s:not enough free space on disks; 查看ks文件,发现文件中对磁盘进行了clear操作,不会出现主分区占用或磁盘空间不够的问题。KS文件如下: zerombr clearpart --all --drives=sda part /boot --fs...
windows下安装centos的注意事项
环境说明: 宿主机: windows xp sp3 磁盘分区结构:主 分区 C 扩展分区 D E F G 项目需求: 需在在此宿主机上再安装一个linux系统,在此以CentOS5.5 x86_64为例 注意事项: 1、 建议此系统单独安装到一个分区,并且此分区最好不要设为主分区;
在戴尔服务器上安装linux
今天在一台新的戴尔服务器上开始安装linux,插入光盘后选择【SATA opticalDRIVECE】进入,发现光驱无法引导进入安装界面,直接进入原来的windows server 2003系统界面,按F2进入检查bioss设置是否正确,设置正常,直接插入光盘, 进入原有系统双击光驱符,提示“insert a disk into drive ”,经过判断应该光驱连接问题,终于通过us...
系统维护与使用区
19,613
社区成员
74,602
社区内容
发帖
与我相关
我的任务
系统维护与使用区
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
复制链接
扫一扫
分享
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章