SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Performance issue due to high memory usage


Performance issue due to high memory usage

Author
Message
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87173 Visits: 45270
SQLCrazyCertified (1/5/2013)
So, if I understand you correctly, if SQL uses all the memory which is allocated to it, then SQL will not have enough memory to work on other outstanding processes


Huh?
SQL uses its memory for all its processes, for the data cache, the plan cache and the several other caches that it has and for anything else it needs memory for.

If that's the case how can you say it's the normal expected behavior?


Because it is normal, expected behaviour.

It would not be efficient for SQL to request memory from the OS for one process, release it when that process is done, request memory from the OS for another, release, etc. If it did, it would be spending huge amounts of time and resources requesting and and releasing memory rather than actually doing productive work. Hence it requests memory, does not release it (unless the OS complains) and manages it after that point.

See the book I previously referenced, chapter 4.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


SQLisAwE5OmE
SQLisAwE5OmE
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1056 Visits: 3068
Ok. Thank you. I will read further.

SueTons.

Regards,
SQLisAwe5oMe.
SQLRNNR
SQLRNNR
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32276 Visits: 18552
SQLCrazyCertified (1/4/2013)
SQLRNNR, There are only 50 active connections.....so, I don't think this is the issue.

Joie Andrew, Had complains that everything is running slow and I coudn't find anything else other than SQL using all the memory which is allocated to it.

GilaMonster, I am not 100% sure if it's only memory related, however, I am stuck as to what's the next step....not an exper on performance tuning.

Grant Fritchey, I did select * from sys.dm_os_wait_stats, now which column should I focus.

I really appreciate all of you for giving me valid inputs as to where/what should I be checking. Could this be a CPU issue as well?

Thanks,
SueTons.




Connections to the database take resources and do consume memory. That added to the waits that Grant asked about would help to understand memory pressure.

Did you check with your users to find out where the app is slow?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

SQLisAwE5OmE
SQLisAwE5OmE
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1056 Visits: 3068
[/quote]
Connections to the database take resources and do consume memory. That added to the waits that Grant asked about would help to understand memory pressure.

Did you check with your users to find out where the app is slow?[/quote]

We only found active 50 connections....which is not much. In additions to SQL using all the memory, we are also getting some error as below.

'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ", and also error 40 displayed in certain web application.'

However, this is only happening occasionally and everything else looks fine from the database end.

SueTons.

Regards,
SQLisAwe5oMe.
Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39747 Visits: 32639
When looking at the wait stats, order them by the total wait time and you can see what is causing things to slow down. This is a simple version of the query:
SELECT TOP (10)
*
FROM sys.dm_os_wait_stats AS dows
ORDER BY wait_time_ms DESC;



The wait types themselves are not self-explanatory (although some are). You'll have to look them up to understand what's causing things to slow down on your system.

Also, if you really are focused on memory, you can use sys.dm_os_ring_buffers to check for specific out of memory messages. I wrote up a method for doing that in an article on Simple-Talk.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5238 Visits: 4076
I wil favor here to set the profiler trace (
beware of filters and required columns
), see if you catch there something.

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85923 Visits: 41091
I've been going through this a lot lately and thought I'd share just in case. I don't (yet, but I will) know all the details because the Infrastructure Team owns the resources and "the problem". They have a DR site setup and they use some sort of SAN based replication to keep them in sync. It apparently has some sort of a log (file) and replicates things asynchronusly through the log as a buffer. Everything works great and fast except if the log gets too far behind (typical because of nightly jobs) and the replication goes into what is known as the "synchronus" mode. When it does that, not only do things have to commit on the local server but they also have to commit on the remote server. The connections to the remote server will always be slower than the internal fiber connections we have to the SAN and form the bottle neck. Considering that the system is already way behind when it goes into the synchronuns mode, you can just imagine how slow that makes things.

I'm definitely not sure if this has anything to do with your problem at all or not but you can bet my current problem doesn't show up as a "DR Replication Problem" through the system DMVs. If you have a similar thing going on, the answer won't be obvious either. Check everything and expect the unexpected.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search