SQL server memory usase
Hi Experts,
Can anyone please tell me how can we check SQL server memory usages?
Thanks in Advance
Hi Experts,
Can anyone please tell me how can we check SQL server memory usages?
Thanks in Advance
Can use Perfmon.DMV is the best.Will work for 2008 and above
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
Similar Messages
-
What is difference between 32 bit and 64 bit sql server memory management
What is difference between 32 bit and 64 bit sql server memory management
Thanks
ShashikalaThis is the basic difference...check if helps:
A 32-bit CPU running 32-bit software (also known as the x86 platform) is so named because it is based on an architecture that can manipulate values that are up to 32 bits in length. This means that a 32-bit memory pointer can store a value between 0 and
4,294,967,295 to reference a memory address. This equates to a maximum addressable space of 4GB on 32-bit platforms
On the other hand 64-bit limit of 18,446,744,073,709,551,616, this number is so large that in memory/storage terminology it equates to 16 exabytes. You don’t come across that term very often, so to help understand the scale, here is the value converted to
more commonly used measurements: 16 exabytes = 16,777,216 petabytes (16 million PB)➤ 17,179,869,184 terabytes (17 billion TB)➤ 17,592,186,044,416 gigabytes (17 trillion GB)➤
As you can see, it is significantly larger than the 4GB virtual address space usable in 32-bit systems; it’s so large in fact that any hardware capable of using it all is sadly restricted to the realm of science fiction. Because of this, processor manufacturers
decided to only implement a 44-bit address bus, which provides a virtual address space on 64-bit systems of 16TB. This was regarded as being more than enough address space for the foreseeable future and logically it’s split into an 8TB range for user mode
and 8TB for kernel mode. Each 64-bit process running on an x64 platform will be able to address up to 8TB of VAS.
Please click the Mark as answer button and vote as helpful if this reply solves your problem -
Hi,
How to find out the current utilization of Ram in sql server? and how to restrict the ram for sql server windows 2008r2 with 64bit os?Hi,
How to find out the current utilization of Ram in sql server? and how to restrict the ram for sql server windows 2008r2 with 64bit os?
Hi,
Below query will give you memory utilized by SQL server
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory
You can restrict only buffer pool by putting limit on MAX Server memory using below query
sp_configure 'show advanced options' ,1
go
reconfigure
go
sp_configure 'max server memory MB',xxx --value you want to put
go
reconfigure
Please note that even if yu put cap on max server memory still SQL server can consume more memory that max limit and this memory will be direct memory allocation done by windows for features like SQLCLR,XML,Stack threads, Linked servers.
More details
http://social.technet.microsoft.com/wiki/contents/articles/22316.sql-server-memory-and-troubleshooting.aspx
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles -
SQL Server Memory Usage Peaks to 95% and its not releasing SQL 2012
We are currently running SQL 2012 64 bit, Lock Pages Enabled, 128 GB. We allocated Max Memory 112000, Min Memory to 0. We have a SQL Maintenace Job which backs up (Full Backup) of our server around 11PM at that time the SQL Server memory peaks to almost
96% even during full business hours we are constantly in the range of 56 to 60% but after 11PM within 10 minutes of the job it peaks to 95 or 96 Percentage and even after the job completes it's not releasing the memory back. I have to manually shut the sql
service and then restart at that time it comes back to normal.
Any suggestions/any help really appreciated.Here are the details Memory is at 96% I still didn't restart...Please any help appreciated...The memory detals is for 24 hours I restarted the service around 11AM before I posted my previous message..
Memory Used by SqLServer: 119329
Locked Pages Used SQLServer : 105969
Total VAS in MB : 8388607
Process Physical Memory Low : 0
Process Virtual Memory Low : 0
Max Memory set to :112000
Out of 128 Memory Last 24 hours the memory usage in %
Percent Memory Used - Total Memory is 128.0 GB
Last 24 Hours
DATE / TIME
Memory Used
19-Dec-14
11:46 PM
96.24659602
20-Dec-14
12:46 AM
96.24578349
20-Dec-14
1:46 AM
96.25146739
20-Dec-14
2:46 AM
96.24345652
20-Dec-14
3:46 AM
96.27311834
20-Dec-14
4:46 AM
96.28947067
20-Dec-14
5:46 AM
96.18931325
20-Dec-14
6:46 AM
96.09323502
20-Dec-14
7:46 AM
96.07915497
20-Dec-14
8:46 AM
96.07906977
20-Dec-14
9:46 AM
96.0784111
20-Dec-14
10:46 AM
96.07415009
20-Dec-14
11:46 AM
26.03422141
20-Dec-14
12:46 PM
33.57474359
20-Dec-14
1:46 PM
39.466561
20-Dec-14
2:46 PM
41.85940742
20-Dec-14
3:46 PM
43.89071274
20-Dec-14
4:46 PM
45.80877368
20-Dec-14
5:46 PM
46.49493281
20-Dec-14
6:46 PM
46.68486468
20-Dec-14
7:46 PM
46.69701958
20-Dec-14
8:46 PM
46.69994736
20-Dec-14
9:46 PM
57.5012455
20-Dec-14
10:46 PM
96.25695419
I verified its a sqL job and still my memory is 95%
It peaeked at 10:46PM and here are the details of the SQL job which started at 10:30
Progress: 2014-12-20 22:30:04.39
Source: Check Database Integrity Task Executing query "USE [DATASTORE] ".: 50% complete End Progress Progress: 2014-12-20 22:43:06.10
Source: Check Database Integrity Task Executing query "DBCC CHECKDB(N'DATASTORE') WITH NO_INFOMSGS ".: 100% complete End Progress
Progress: 2014-12-20 22:43:06.11 Source: Check Database Integrity Task Executing query "USE [ETL_Proc] ".: 50% complete
End Progress Progress: 2014-12-20 22:46:52.56 Source: Check Database Integrity Task Executing query "DBCC CHECKDB(N'ETL_Proc')
WITH NO_INFOMSGS ".: 100% complete End Progress Progress: 2014-12-20 22:46:52.64 Source: Back Up Database Task
Executing query "EXECUTE master.dbo.xp_create_subdir N'P:\SQL_Backu...".: 20% complete End Progress
Progress: 2014-12-20 22:46:52.64 Source: Back Up Database Task Executing query "EXECUTE master.dbo.xp_create_subdir N'P:\SQL_Backu...".
: 40% complete End Progress Progress: 2014-12-20 22:46:52.64
Source: Back Up Database Task Executing query "EXECUTE master.dbo.xp_create_subdir N'P:\SQL_Backu...".: 60% complete
End Progress Progress: 2014-12-20 22:46:52.64 Source: Back Up Database Task
Executing query "EXECUTE master.dbo.xp_create_subdir N'P:\SQL_Backu...".: 80% complete End Progress
Progress: 2014-12-20 22:46:52.64 Source: Back Up Database Task
Executing query "EXECUTE master.dbo.xp_create_subdir N'P:\SQL_Backu...".: 100% complete End Progress
Progress: 2014-12-20 22:46:55.63 Source: Back Up Database Task
Executing query "BACKUP DATABASE [ReportServer] TO DISK = N'P:\SQL...".: 100% complete
End Progress Progress: 2014-12-20 22:46:56.55 Source: Back Up Database Task
Executing query "BACKUP DATABASE [ReportServerTempDB] TO DISK = N'...".: 100% complete End Progress Progress: 2014-12-20 22:46:57.35
Source: Back Up Database Task Executing query "BACKUP DATABASE [dbamaint] TO DISK = N'P:\SQL_Bac...".: 100% complete End Progress
Progress: 2014-12-20 22:51:13.08 Source: Back Up Database Task
Executing query "BACKUP DATABASE [DATASTORE] TO DISK = N'P:\SQL_Ba...".: 100% complete End Progress
Progress: 2014-12-20 22:51:52.72 Source: Back Up Database Task
Executing query "BACKUP DATABASE [ETL_Proc] TO DISK = N'P:\SQL_Bac...".: 100% complete End Progress Progress: 2014-12-20 22:51:54.87
Source: Rebuild Index Task Executing query "USE [ReportServer] ".: 0% complete End Progress Progress:
2014-12-20 22:51:54.88 Source: Rebuild Index Task Executing query "ALT... The package executed successf... The step succeeded. -
Hi All,
I am not sure if this is a fair ask or no but this is something i want to learn much internals about sql server memory and how sql server responds to memory pressure and i wanted to see that practically.
Environment : windows 2003, 4 GB physical RAM, SQL server 2005 sp4.
Checking in if someone has some demo tsql scripts which can blow up memory so that i can setup the memory counters and monitor sql server memory usage.
Did anyone has done this earlier?
Thanks in advance.Why do I see “A significant part of sql server process memory has been paged out. This may result in performance degradation.” By SQL Server In spite of having above mechanism to detect the system level memory pressure and scale
SQL Server memory?
There are couple of situations where SQL Server Process working set might be paged out by Windows despite these memory resource notification mechanism.
1.If windows is not sending the correct notifications to all listening processes at the right moment and thresholds
2.If SQL Server is not responding fast enough to the low memory resource notification from Windows
3.Conditions in Windows where working sets of all processes are trimmed
4.Windows might decide to trim a certain percentage of working set of various or specific processes
Above is from
A significant part of SQL Server process memory has been paged out.
Please use Marked as Answer if my post solved your problem and use
Vote As Helpful, if a post was useful to help other user's find a solution quicker. -
SQL Server memory Configuration - SCOM 2012 R2
Hi,
The following article http://technet.microsoft.com/en-us/library/gg682077#BKMK_SupConfigSQLDBconfig states the following about SQL Server memory configuration for SCCM:
When you use a database server that is co-located with the site server, limit the memory for SQL Server to 50 to 80 percent of the available addressable system memory.
When you use a dedicated SQL Server, limit the memory for SQL Server to 80 to 90 percent of the available addressable system memory.
The question is:
Is there any advice (from technet articles) about SQL Server memory configuration for SCOM 2012 R2?
Thanks in advance!Hi There,
Read the 5th point below
General SQL Server recommendations for System Center 2012 R2
This information describes general recommendations for SQL Server regardless of what System Center component you are deploying.
You will need a minimum of four computers to deploy all System Center components. Aside from performance reasons, not all system components can coexist on the same computer. For more information, see Component
Coexistence for System Center 2012 R2.
For testing purposes only, one SQL Database Engine Services instance may be used for all components, but is not recommended in a production setting due to performance concerns.
Reporting Services instances cannot be shared between System Center components.
SQL_* collations are being deprecated for their Windows equivalents.
Limit the memory of each SQL Server instance such that the Total Memory setting allows a minimum of 1 GB (2GB preferred) of free memory after all services are running.
System Center components requiring the most disk resources are Service Manager, Operations Manager and Configuration Manager.
Disks used should be formatted to a 64K allocation unit size.
Disks used should be configured to allow 20% free space after all calculations for monitoring. Set growth upper limits to not exceed this space limit.
Pre-sizing is preferred - use auto-grow if needed as it uses more resources.
Set Pre-size to 8GB/2GB as a minimum. 20-30% of the database file size is a rule of thumb.
Set Auto-grow to 500/100 as a minimum.
Refer: http://technet.microsoft.com/en-in/library/dn281933.aspx
Gautam.75801 -
SQL Server Memory usage is high
Hello,
One of our production SQL cluster is eating up more memory on server.
Here are the server specifications :
OS : Windows 2008 R2 Enterprise
SQL : SQL Server 2008 SP2 standard edition ( 2 node cluster )
Memory : 16 GB ( 8 Gb to SQL and rest to OS )
CPU : 8
This server is heavily used by CLR and linked server events.
I have seen the memory usage of databases , it's not using more than 7 GB and leaving 1 GB free in sql memory area ( from our Idera SQL dm
monitoring tool ). I'm suspecting CLR events are causing these spikes.
When i look at the task manager sqlserver.exe is using 15.7 Gb ( close to 16 GB )
Not sure how to see which process are using the memory.
Also we are seeing the below error messages in error log very frequently
10/27/2014 15:23:52,spid1s,Unknown,AppDomain 85 (xxxxxx) is marked for unload due to memory pressure.
I have looked at some blogs in internet, i didnt get any correct info. I have seen this is kind of bug in SQL 2005 32-bit system but we are
using 64 bit system.
http://support.microsoft.com/kb/969962
Can anyone please help me on this ?
Thanks in advanceContinuation of DBCC memorystatus output
CACHESTORE_TEMPTABLES (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 40
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_NOTIF (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 16
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_VIEWDEFINITIONS (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 16
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_XMLDBTYPE (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_XMLDBELEMENT (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_XMLDBATTRIBUTE (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_STACKFRAMES (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 0
MultiPage Allocator 8
(7 row(s) affected)
CACHESTORE_STACKFRAMES (node 64) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 0
MultiPage Allocator 8
(7 row(s) affected)
CACHESTORE_STACKFRAMES (Total) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 0
MultiPage Allocator 16
(7 row(s) affected)
CACHESTORE_BROKERTBLACS (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 48
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERKEK (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERDSH (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERUSERCERTLOOKUP (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERRSB (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERREADONLY (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 32
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_BROKERTO (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_EVENTS (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 16
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_CLRPROC (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 40
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_SYSTEMROWSET (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 1856
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_CONVPRI (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 48
MultiPage Allocator 0
(7 row(s) affected)
CACHESTORE_FULLTEXTSTOPLIST (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 32
MultiPage Allocator 0
(7 row(s) affected)
USERSTORE_SCHEMAMGR (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 16432
MultiPage Allocator 856
(7 row(s) affected)
USERSTORE_DBMETADATA (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 5592
MultiPage Allocator 0
(7 row(s) affected)
USERSTORE_TOKENPERM (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 3856
MultiPage Allocator 3960
(7 row(s) affected)
USERSTORE_OBJPERM (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 2328
MultiPage Allocator 0
(7 row(s) affected)
USERSTORE_SXC (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 656
MultiPage Allocator 0
(7 row(s) affected)
USERSTORE_SXC (node 64) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 8
MultiPage Allocator 0
(7 row(s) affected)
USERSTORE_SXC (Total) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 664
MultiPage Allocator 0
(7 row(s) affected)
OBJECTSTORE_LBSS (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 128
MultiPage Allocator 608
(7 row(s) affected)
OBJECTSTORE_SNI_PACKET (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 2008
MultiPage Allocator 56
(7 row(s) affected)
OBJECTSTORE_SNI_PACKET (node 64) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 0
MultiPage Allocator 56
(7 row(s) affected)
OBJECTSTORE_SNI_PACKET (Total) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 2008
MultiPage Allocator 112
(7 row(s) affected)
OBJECTSTORE_SERVICE_BROKER (node 0) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 424
MultiPage Allocator 0
(7 row(s) affected)
OBJECTSTORE_LOCK_MANAGER (node 0) KB
VM Reserved 32768
VM Committed 32768
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 4048
MultiPage Allocator 0
(7 row(s) affected)
OBJECTSTORE_LOCK_MANAGER (node 64) KB
VM Reserved 0
VM Committed 0
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 24
MultiPage Allocator 0
(7 row(s) affected)
OBJECTSTORE_LOCK_MANAGER (Total) KB
VM Reserved 32768
VM Committed 32768
Locked Pages Allocated 0
SM Reserved 0
SM Committed 0
SinglePage Allocator 4072
MultiPage Allocator 0
(7 row(s) affected)
Buffer Pool Value
Committed 1024000
Target 1024000
Database 793462
Dirty 36258
In IO 0
Latched 0
Free 171398
Stolen 59140
Reserved 0
Visible 1024000
Stolen Potential 913660
Limiting Factor 17
Last OOM Factor 0
Last OS Error 0
Page Life Expectancy 262733
(15 row(s) affected)
Process/System Counts Value
Available Physical Memory 69021696
Available Virtual Memory 8762135273472
Available Paging File 12716019712
Working Set 15196917760
Percent of Committed Memory in WS 100
Page Faults 897824874
System physical memory high 0
System physical memory low 0
Process physical memory low 0
Process virtual memory low 0
(10 row(s) affected)
Procedure Cache Value
TotalProcs 4573
TotalPages 53712
InUsePages 27
(3 row(s) affected)
Global Memory Objects Pages
Resource 412
Locks 509
XDES 219
SETLS 8
SE Dataset Allocators 16
SubpDesc Allocators 8
SE SchemaManager 1169
SE Column Metadata Cache 991
SQLCache 893
Replication 2
ServerGlobal 52
XP Global 2
SortTables 3691
(13 row(s) affected)
Query Memory Objects (internal) Value
Grants 0
Waiting 0
Available 756700
Current Max 756700
Future Max 756700
Physical Max 756700
Next Request 0
Waiting For 0
Cost 0
Timeout 0
Wait Time 0
(11 row(s) affected)
Small Query Memory Objects (internal) Value
Grants 0
Waiting 0
Available 12800
Current Max 12800
Future Max 12800
(5 row(s) affected)
Optimization Queue (internal) Value
Overall Memory 6723993600
Target Memory 5965963264
Last Notification 1
Timeout 6
Early Termination Factor 5
(5 row(s) affected)
Small Gateway (internal) Value
Configured Units 32
Available Units 32
Acquires 0
Waiters 0
Threshold Factor 380000
Threshold 380000
(6 row(s) affected)
Medium Gateway (internal) Value
Configured Units 8
Available Units 8
Acquires 0
Waiters 0
Threshold Factor 12
Threshold -1
(6 row(s) affected)
Big Gateway (internal) Value
Configured Units 1
Available Units 1
Acquires 0
Waiters 0
Threshold Factor 8
Threshold -1
(6 row(s) affected)
Memory Pool Manager Pages
Reserved Current 0
Reserved Limit 913664
(2 row(s) affected)
Memory Pool (internal) Pages
Allocations 59136
Predicted 248311
Private Target 0
Private Limit 0
Total Target 972800
Total Limit 972800
OOM Count 0
(7 row(s) affected)
MEMORYBROKER_FOR_CACHE (internal) Pages
Allocations 55358
Rate 0
Target Allocations 779847
Future Allocations 0
Overall 820800
Last Notification 1
(6 row(s) affected)
MEMORYBROKER_FOR_STEAL (internal) Pages
Allocations 3778
Rate 0
Target Allocations 728267
Future Allocations 0
Overall 820800
Last Notification 1
(6 row(s) affected)
MEMORYBROKER_FOR_RESERVE (internal) Pages
Allocations 0
Rate 0
Target Allocations 820800
Future Allocations 189175
Overall 820800
Last Notification 1
(6 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator. -
Microsoft Jdbc driver for SQL Server memory leak
I'm using Microsoft Jdbc driver and see there's some leak after running application for a while. I'm sure that it's from Jdbc driver because I sitch to Jtds and the issue went away. My question is is there anybody knows which web sites talk about memory leak issue in Microsoft Jdbc driver for SQL Server?
Appreciate your helpI'm using Microsoft Jdbc driver and see there's some leak after running application for a while. I'm sure that it's from Jdbc driver because I sitch to Jtds and the issue went away. My question is is there anybody knows which web sites talk about memory leak issue in Microsoft Jdbc driver for SQL Server?
Appreciate your help -
SQL Server Memory And Di Object
Hello Experts
I'm doing a loop which use some DI Objects. This loop occurs more than 80 000 times.
In this loop I manage a BusinessPartner Di Object like that
private static SAPBobsCom.BusinessPartners myPartners;
while(...)
myPartners = (SAPBobsCom.BusinessPartners)Di.GetBusinessObject(oBusinessPrtners);
myPartners.GetbyKey(...)
//treatments
//Sometimes
myPartner.Add()
myPartner.Update()
//Always
System.runtime.....releaseComObject(myPartner)
GC.Collect();
GC.WaitForPendingFinalizers();
It works fine but the sqlServer Process take more and more Memory and arrive to 1 200 mb RAM.
I have to re-start the SQL Server Service to erase memory, no DBCC query work.
have you any Idea to stop this memory grow ?
Thanks a lot for Ideas...Hi Julien,
The amount of memory that SQL Server takes should level out. When you run an intensive process the memory manager will start taking chunks of memory to boost performance. Typically it won't release this memory unless the server is low on physical memory and another application requires more memory. However, when you next run the process, SQL will use up the RAM that is already available to it before requesting more. This should mean that your process will not take any significant extra memory next time it is run (assuming the same workload at the time).
SQL will typically only have a 100MB footprint when it has just been started. On a production system, I would expect to see 1-2GB of memory being used by SQL on an average SBO site (more for larger sites and more if the client uses large XL Reporter reports or query intensive addons like Fixed Assets).
Although SQL Server 2000 was a little prone to leaking memory, I have not known this to be the case in SQL 2005.
Have you tested running your script twice in a row?
Kind Regards,
Owen -
Sql server is using memory more then there max memory setting?
Hi All,
today i have faced the different issue..........
we have one SQl server 2008 prod server... it have memory issue actually total server memory is 8GB and we have allocated the 6 GB to SQL server,we checked the server no open trans and dont have running jobs also,one database is using the memory high(no
open trans)... but Sql server has used 6.5 GB (6 GB) and total server used memory is reached to 7.89 GB.
Please tell me how to find the most costly query in particular database wise and sql server internally behavior ?
how to troubleshot the above issue?
please post the your valuable answers ASAP...
Thanks,
RAMPlease refer to what Olaf said briefly.Buffer pool in SQL server only caters to memory requests which requires pages <8 KB . Almost all requests are satisfies by buffer pool and generally request for memory is small and so buffer pool satisfies the requests.
However there are some direct memory allocation by windows API which is done by windows for requests which requires memory greater than 8 KB. This memory wont come from buffer pool and this would be counted in memory utilized by SQL server. SQL
CLR,XML, linked Server, all takes memory outside buffer pool in SQL Server 2008. This behavior changed in 2012 so my statement only applies to SQL server 2005/2008 and 2008 R2.
I would run below to check SQL server memory utilization.
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory
I am sure you must be using some features mentioned above.You were worried that even though there is no query running on SQL server it has still holded up the memory. This is default behavior and this is how memory management in SQL Server works. It will
not release memory untill SQLOS asks it to do so which is told by windows OS thorugh some flag that it is facing memory pressure.
Please read below for more details on memory. There is section to test whether system is facing memory crunch please read that as well.
http://social.technet.microsoft.com/wiki/contents/articles/22316.sql-server-memory-and-troubleshooting.aspx
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles -
SQL Server 2012- Memory Leak Issue
Team,
We are running a Mission Critical Application on SQL Server 2012 SP2(11.0.5058) which is configured on Always ON Synchronous mode. Offlate due to heavy development work, Application team have come up with stating memory issues. I have analysed all the areas
and everything looks normal. Please suggest if we have to patch the latest CU4 for SQL Server 2012 SP2.
The checks were performed on the below areas:
- Errorlog, System Logs - No errors reported.
- There are close to 8 Databases hosted on the instances which are all configured for AlwaysON. SQL Server is running on VM Infrastructure and the total physical memory allocated is 96GB out of which SQL is capped for 92GB.
-The Page Life Expectancy is healthy and is showing a greater number. There are no Signal waits either or pending memory grants.
- The writes are more than reads for one of the databases which is flagged with application team. There are no blockings & Deadlocks.
Please suggest me the future course of action and your inputs are much appreciated.
Best Regards,
SharathActual issue is- Application team have reported a memory leak and their builds have significantly slowed down. They suspect that its Database memory leak. However I have verified from database end and gave the above inputs.
The AOAGs are good. I was looking for any pointers whether there are any bugs which is related to memory leaks in SQL Server 2012. I know all of them are addressed with SQL Server 2012 SP2.
Application team has NO idea about SQL Server do they ? And to say SQL Server has memory leak you have to actually prove it did they showed any proof. Its common for application team to say SQL Server is leaking memory because they are unaware about fact
by default SQL Server would take as much memory as possible and would release when SQLOS asks it to do so. This might give sign that it is leaking memory BUT IT IS NOT.
As you already said AOAG is working fine so I am presuming there is nothing much to worry. To monitor memory usage in SQL Server 2012 you can use below counters
SQL Server: Memory Manager-- Target Server Memory (KB)
SQL Server: Memory Manager--Total Server Memory (KB)
SQL Server: Memory Manager- Free Memory (KB)
SQL Server: Memory Manager--Database Cache Memory (KB)
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
SQL Server Max Memory Settings
Hi,
I'd like to check if SQL Server will consume memory more than the configured MAX Memory settings? And if so when does SQL consume that and how much would it consume.
Regards,
JayHi,
I'd like to check if SQL Server will consume memory more than the configured MAX Memory settings? And if so when does SQL consume that and how much would it consume.
Hi
Can you please tell us what is version and edition of SQL Server here. If it is 2012 its little difficult to reporduce your scenario where SQL Server 2012 will take more than max server memory setting because lots of features which use to take memory
outside buffer pool before SQL 2012 are now changed to take memory from buffer pool. Also quite lot depends on whether system is 32 bit or 64 bit
For SQL Server versions below 2012(not SS2000) you might get lucky with following (taken from
Here)
1. COM Objects
2. SQL Server CLR
3. Memory allocated by Linked Server OLEDB Providers and third party DLL’s loaded in SQL Server process
4. Extended Stored Procedures:
5. Network Packets
6. Memory consumed by memory managers. If the memory request is greater than 8 KB and needs contiguous allocation.
7. Backup
If you heavily use above features you might see SQL Server memory utilization crossing above max server memory setting. Of all above SQLCLR and extended stored procs would be my bet. If you use them heavily you might see what you want to. Extended
stored proc has performance issues so use it on your own risk. Use below query to check SQL server memory utilization( works from SS 2008 and above)
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles -
Hi,
I know that , max server memory property is about physical memory limit for buffer pool. But some says that, it is about Vas (virtual adress space) limit for buffer pool. I know that , Vas structure includes
physical memory and virtual memory. Then it means that max server memory is not equal max
physical memory for buffer pool.
Which one is true?Both are true depending on the memory model your SQL Server is using
In conventional memory model. Max server memory is about memory limit for Bpool ( Bpool can be from RAM or Page file), so there is no guarantee that bpool will always be placed in physical memory it can be paged to page file when there is memory pressure.
In Lock pages and large pages memory model Bpool cant be paged and always placed in RAM so its limit for BPOOL in RAM
I assume you are referring Page file as virtual memory and RAM as
physical memory
Read http://mssqlwiki.com/2013/03/26/sql-server-lock-pages-in-memory/ and http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/ you will get clarity
Thank you,
Karthick P.K |My blogs|My Scribbles|Twitter|My Facebook
Group|
www.Mssqlwiki.com
Please click the Mark as answer button and vote as helpful if this reply solves your problem -
SQL Server 2008R2 memory issues
Hi Experts.
I have SQL Server 2008R2 installation,We allocated 102400MB(100GB) Memory out of 128GB Installed.
But Task manager is showing SQL Servr using 104 GB.Please some body let us know why SQL Server uisng more memory more than we allocated.
Please advise next step or recommendations if any
OS :Windows 2008R2 64bit.
DB:SQL Server 2008R2 64bit.
Thanks in advance.
Regards,But Task manager is showing SQL Servr using 104 GB.Please some body let us know why SQL Server uisng more memory more than we allocated.
You should not refer to task manager for SQL server memory consumption. Its windows tool it always wont show you correct value.
Please use below query to SQL Server memory utilization
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB
from sys. dm_os_process_memory
100 G limit is put on SQL Server buffer pool. SQL Server can still use memory more than 100 G because few memory allocations for objects like, XML,SQLCLR, Linked server, backup , database mail etc are allocated directly by windows and sys.dm_os_process_memory
does not tracks it. So just relax this is normal
Task manager only show Working set.
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
SQL Server 2012 taking more memory
I have sql server 2012 it taking more memory. for example i allocate 100 GB but it's taking 250GB and above. while
i checking in resource monitor it's showing and there is no process is running (sp_who2)I have sql server 2012 it taking more memory. for example i allocate 100 GB but it's taking 250GB and above.
while i checking in resource monitor it's showing and there is no process is running (sp_who2)
I guess you allocated 100 G(arbitrary value) to buffer pool. Even though in SQL Server 2012 buffer pool was changed to cater to memory requests for many processes which were previously satisfied by Windows API directly (not from buffer pool) still there
are processes which can cause memory allocation outside buffer pool and thus increase SQL server memory consumption more than what is assigned to buffer pool so what you are seeing IS NORMAL BEHAVIOR.
http://blogs.msdn.com/b/sqlosteam/archive/2012/07/12/memory-manager-configuration-changes-in-sql-server-2012.aspx
Can you please post output of below query
select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory
How much RAM does your system has and what is Max server memory ?
SQL server once taken memory will not release until SQLOS asks it to do so upon seeing low memory notification flag. Memory is managed dynamically and SQL Server by default caches as much as possible to avoid I/O reads which is time taking an costly
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles
Maybe you are looking for
-
Is it possible for creating draft BOM and fix approvals in SAP BI
Can we create draft BOM and set approval for BOM ? If any changes are made in BOM after approval this can be set as amendment to the original BOM.
-
Deauthorize Computer? My own Music?
I've been a LONG time user of mac (1986+) and i actually feel embarrased to NOT understand this: I Just bought 2 days ago a Macbook. I LOVE the ipod-style remote interface, and decided to import some of me cds so when I hook up the laptop to my theat
-
How to assign values for more than one field
Hi, I have written following code constants: fieldname(30) value '(SAPMF02D)KNA1-AUFSD'. constants: fieldname1(30) value '(SAPMF02D)KNA1-LISFD'. constants: fieldname2(30) value '(SAPMF02D)KNA1-FAKSD'. field-symbols: <L_FIELD> TYPE ANY. field-symbols
-
I can put in an address and subject, but there is no cursor in the message box.
After I put in the address & subject, I click on the message box to do some typing, but all it does is sit there. Up in the tool bar, the little circle is just spinning counterclockwise until I click in the message box, then it reverses to clockwise
-
Hi I bought Photoshop Elements 12 and Premiere Elements 12th The installation went fine (Opsys Vista). When I start the program I come to Sign In. I enter an Adobe ID and password, login starts but nothing more happens without it just waiting for an