Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 memory usage after Reorganization index

Author  Topic 

bissa
Starting Member

32 Posts

Posted - 2015-02-04 : 09:35:20
Hello,
The sqlsrv.exe after running the reorganization or rebuild indexes, it will use over 95% of the memory usage (32GB), how I can reset the memory usage without the need to restart the mssql service?

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-04 : 10:04:32
have you set min and max memory in the instance properties? If so, to what values? If not, set them to reasonable values. Min should be no more than the average working set. Max should be no more than 2 GB less than available memory (fwiw 95% of 32gb is 30.4 gb). But you have to make allowance for any other processes on the server (e.g. other SQL instances)

Note that SQL Server will return unused memory to the OS but not go below the min value.

Run this query and post the results:


SELECT
(physical_memory_in_use_kb/1024) AS Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024) AS Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024) AS Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
FROM sys.dm_os_process_memory;
Go to Top of Page

bissa
Starting Member

32 Posts

Posted - 2015-02-04 : 10:10:07
I haven't sent min or max, it is set to default values.

running this query I get
26112 0 8388607 0 0
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-04 : 10:24:14
so, you're currently using about 26GB. is that typical for your instance?
Go to Top of Page

bissa
Starting Member

32 Posts

Posted - 2015-02-04 : 10:26:40
This memory usage is after running the reorganize index maintenance plan, normal SQL memory usage is around 15GB ~ 20GB before running the reorganization
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-04 : 10:29:56
OK -- so set your min to 15gb and your max to 30gb (or less). If there is nothing else on the server, this should be fine. Note that it appears sql has already given back about 4 gb. Run the query I posted every few minutes and you should see the memory_used continue to drop. If it does not, perhaps you're wrong about the 15-20gb
Go to Top of Page
   

- Advertisement -