Sql-server – SQL Server taking a lot of memory

sql serversql-server-2005sql-server-express

I have SQL Server Express on my VPS(2GB RAM) with a database size of 1.5 GB that I expect will increase to 15 GB. I have noticed that SQL Server is using 1.5 GB RAM even when only small queries has been run against the database.

Is there any relation between memory and database size? Can I tune my SQL Server so it can handle memory better and not use as much memory as it does now?

Here is the memory status of SQL Server:

VM Reserved,1455488
VM Committed,19320
AWE Allocated,0
Reserved Memory,1024
Reserved Memory In Use,0

Best Answer

SQL Server is known for by default consuming as much memory as the OS allows it to take, so you'll have to reduce it manually.

One way of doing this is described here and here. On the second link, specifically, you will find this example that might be useful for you:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max server memory', 4096;
GO
RECONFIGURE;
GO

Instead of 4096, you might want to enter something smaller depending on your available RAM.

And, as @outcoldman says in a comment to your question, SQL Server Express doesn't allow 15 GB databases. This answer specifies 4 GB max for SQL Server Express 2005 and 10 GB max for SQL Server Express 2008 & 2012.