Chris Webb's BI Blog

Analysis Services, MDX, PowerPivot, DAX and anything BI-related

Query behaviour when you cross the LowMemoryLimit

with 2 comments

Here’s something that had me stumped for quite a long time earlier this week…

I’m doing some performance tuning work for a customer at the moment, and following my usual approach I took a test query, cleared the cache, ran it and noted how long it ran for and what I saw in Profiler and MDX Studio. However this time I saw some strange things happening: I’d run the same query on a cold cache more than once and the query times would differ by anything up to a minute; even more confusing, the information I got from Profiler and MDX Studio would be different too – for example, the number of Query Subcube Verbose events in recorded in Profiler for a query might differ from run to run by several hundred. This had me completely confused. There was no-one else on the server and I was running on a cold cache. What was going on?

It turned out that I was running out of memory. I was working on a 32-bit box with a lot of databases on, so even on a cold cache the amount of memory used by SSAS was approaching the LowMemoryLimit threshold (see Marco’s post here, the AS2005 Performance Guide and this white paper for an explanation of what this is). When I ran the query – which had a lot of calculations – memory usage went above the LowMemoryLimit so the cleaner thread was waking up and evicting elements of shrinkable memory, which presumably included data in cache that had been put there by the current query. Since the exact moment that this threshold was crossed would vary from run to run, and as I assume that what the cleaner thread would evict from memory would also vary, this explained the different query times and Profiler activity. As soon as I moved onto a 64-bit box with no other databases this stopped happening.

Of course nowadays I would expect that most people are running on 64-bit so it’s much more unlikely that you’ll ever cross the LowMemoryLimit, but I do see it happen from time to time. So if you’re in the same position and suffer from inconsistent query performance, check your memory usage!

Written by Chris Webb

March 19, 2009 at 11:28 pm

Posted in Analysis Services

2 Responses

Subscribe to comments with RSS.

  1. Hi Chris,This is interesting, I\’ve been facing with performance issues for the last month. The difference is that I have 64 bits servers. But I don\’t discard problems with memory usage.How can I check if the AS2005 is reaching that limit? Is there a specific perfmon counter?Best regards,Fernando

    Fernando

    March 20, 2009 at 5:45 pm

  2. Take a look at the \’Memory Usage KB\’ and \’LowMemoryLimit KB\’ counters in Perfmon. If the first is greater than the second before the query runs, or while it runs, then you\’re hitting this issue. But as I said it\’s highly unlikely this will happen on a 64-bit system – there are probably other more likely causes for your performance problems. I suggest reading the AS2005 Performance Guide for some tips.

    Chris

    March 20, 2009 at 11:19 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 3,202 other followers

%d bloggers like this: