SQL Server中的动态和静态内存分配
我们知道, SQL 服务器有两种管理方法,分别是 动态 分配 和 静态 分配 ,用以控制程序可使用的 内存 数量。 动态 分配 允许管理员声明一块 内存 的大小;考虑到它的实际使用,SQL服务器可以 分配 给其需要占用的 内存 的最大值,并且(理论上)在没有使用 内存
我们知道,SQL服务器有两种管理方法,分别是动态分配和静态分配,用以控制程序可使用的内存数量。动态分配允许管理员声明一块内存的大小;考虑到它的实际使用,SQL服务器可以分配给其需要占用的内存的最大值,并且(理论上)在没有使用内存的情况下将其释放。静态分配则是创建一块固定的内存空间,提供给SQL Server使用――不再进行分配。
在默认情况下,SQL Server被设置成动态分配,分配给其正在运行的计算机内所有可用的物理内存。许多管理员注意到SQL Server内存随时间的流逝被逐渐消耗殆尽时,其原因很可能是故障或是内存漏洞,但这个程序正是被设计成这样的。SQL Server就是要在任何可能的情况下在电脑中运行,并因此为达到其最佳性能而使用所有可用的内存。如果SQL Server在独立的机器中运行,那么就让它分配和释放其需要的内存吧。
在一个小型商业服务器机器中,SQL可能与其他程序,如IIS,同时运行,管理员或许尝试着进行设置,使SQL Server运行在一块固定大小的内存,目的是控制其不会占用用于共享的内存。但这并不一定能如愿以偿。一方面,将内存的最高限度设置得太低,并且没有分配给SQL服务器足够的可用内存来用作类似事务日志或查询执行的缓存,所有这些都很难办到。使SQL服务器得到执行操作所需内存的惟一方法就是换出其他的页面,这是个缓慢的过程。
有许多方法可以计算出最好的内存分配。如果你有可预知的用户负载,依照用户所需的最大数目分配给他们。微软推荐至少用4 MB用作动态的最大空间,这已经成为一个可能的规则。如果你的用户负载变化范围很大――如以下情况,当你通过IIS 的前端连接到公共的因特网来支持你的数据库服务的时候――实时的统计数据将会比仅凭猜测所作的工作帮助更大。在高峰期,把SQL Server的高速缓存命中率和每秒缺页率等性能数字搜集起来。如果这些数据表明SQL Server正在做大量的交换,那么增加最大内存空间直到交换逐渐减少。每秒一次或更多次的交换是有坏处的。
另一种选择是使“为SQL Server预留物理内存”的选项可用,这可以防止SQL Server把已经分配给它的内存换出,即使当其他应用程序能够使用它时。这可以叫做是一把双刃剑:它既可以相当大程度的提高性能,也可能带来更大的性能损害。在有许多RAM 可以共享的(1 GB 或更多)的系统中,这是值得一试的,但是当有其他关键的进程可能突然需要大量的内存时,这种办法是不应该使用的。(并且如果需要的话,SQL Server可能会被迫放弃一些它自己的内存)。假如SQL Server是在独立的机器上运行,用这种办法最佳化性能是比较值得的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











For mechanical hard drives or SATA solid-state drives, you will feel the increase in software running speed. If it is an NVME hard drive, you may not feel it. 1. Import the registry into the desktop and create a new text document, copy and paste the following content, save it as 1.reg, then right-click to merge and restart the computer. WindowsRegistryEditorVersion5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\MemoryManagement]"DisablePagingExecutive"=d

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

According to news from this website on September 3, Korean media etnews reported yesterday (local time) that Samsung Electronics and SK Hynix’s “HBM-like” stacked structure mobile memory products will be commercialized after 2026. Sources said that the two Korean memory giants regard stacked mobile memory as an important source of future revenue and plan to expand "HBM-like memory" to smartphones, tablets and laptops to provide power for end-side AI. According to previous reports on this site, Samsung Electronics’ product is called LPWide I/O memory, and SK Hynix calls this technology VFO. The two companies have used roughly the same technical route, which is to combine fan-out packaging and vertical channels. Samsung Electronics’ LPWide I/O memory has a bit width of 512

According to the report, Samsung Electronics executive Dae Woo Kim said that at the 2024 Korean Microelectronics and Packaging Society Annual Meeting, Samsung Electronics will complete the verification of the 16-layer hybrid bonding HBM memory technology. It is reported that this technology has passed technical verification. The report also stated that this technical verification will lay the foundation for the development of the memory market in the next few years. DaeWooKim said that Samsung Electronics has successfully manufactured a 16-layer stacked HBM3 memory based on hybrid bonding technology. The memory sample works normally. In the future, the 16-layer stacked hybrid bonding technology will be used for mass production of HBM4 memory. ▲Image source TheElec, same as below. Compared with the existing bonding process, hybrid bonding does not need to add bumps between DRAM memory layers, but directly connects the upper and lower layers copper to copper.

According to news from this website on May 6, Lexar launched the Ares Wings of War series DDR57600CL36 overclocking memory. The 16GBx2 set will be available for pre-sale at 0:00 on May 7 with a deposit of 50 yuan, and the price is 1,299 yuan. Lexar Wings of War memory uses Hynix A-die memory chips, supports Intel XMP3.0, and provides the following two overclocking presets: 7600MT/s: CL36-46-46-961.4V8000MT/s: CL38-48-49 -1001.45V In terms of heat dissipation, this memory set is equipped with a 1.8mm thick all-aluminum heat dissipation vest and is equipped with PMIC's exclusive thermal conductive silicone grease pad. The memory uses 8 high-brightness LED beads and supports 13 RGB lighting modes.

According to a TrendForce survey report, the AI wave has a significant impact on the DRAM memory and NAND flash memory markets. In this site’s news on May 7, TrendForce said in its latest research report today that the agency has increased the contract price increases for two types of storage products this quarter. Specifically, TrendForce originally estimated that the DRAM memory contract price in the second quarter of 2024 will increase by 3~8%, and now estimates it at 13~18%; in terms of NAND flash memory, the original estimate will increase by 13~18%, and the new estimate is 15%. ~20%, only eMMC/UFS has a lower increase of 10%. ▲Image source TrendForce TrendForce stated that the agency originally expected to continue to

According to news from this site on June 7, GEIL launched its latest DDR5 solution at the 2024 Taipei International Computer Show, and provided SO-DIMM, CUDIMM, CSODIMM, CAMM2 and LPCAMM2 versions to choose from. ▲Picture source: Wccftech As shown in the picture, the CAMM2/LPCAMM2 memory exhibited by Jinbang adopts a very compact design, can provide a maximum capacity of 128GB, and a speed of up to 8533MT/s. Some of these products can even be stable on the AMDAM5 platform Overclocked to 9000MT/s without any auxiliary cooling. According to reports, Jinbang’s 2024 Polaris RGBDDR5 series memory can provide up to 8400

When the prices of ultra-high-frequency flagship memories such as 7600MT/s and 8000MT/s are generally high, Lexar has taken action. They have launched a new memory series called Ares Wings ARES RGB DDR5, with 7600 C36 and 8000 C38 is available in two specifications. The 16GB*2 sets are priced at 1,299 yuan and 1,499 yuan respectively, which is very cost-effective. This site has obtained the 8000 C38 version of Wings of War, and will bring you its unboxing pictures. The packaging of Lexar Wings ARES RGB DDR5 memory is well designed, using eye-catching black and red color schemes with colorful printing. There is an exclusive &quo in the upper left corner of the packaging.
