Skip to main content
gamedev.net
🔒 Locked

[web] This normal? SQL Server memory allocation

Started by MrRage Mar 18, 2007 at 1:07 AM 4 replies 850+ views
Original Post
MrRage
MrRage
... try { SqlCommand cmd = new SqlCommand(sqlString, connection); cmd.Parameters.AddWithValue("@time", time); cmd.ExecuteNonQuery(); } catch (...){...} ... It was a simple .NET application, a while loop that used a single database connection and did a series of inserts using a SqlCommand object. The application never bloated and the memory for this application remained stable. However, SQL Server 2005 proceeded to allocate up to its memory limit almost immediately. There were about 20,000 inserts made over the course of an hour I think, and even though the database was only 28mb on the disk – SQL allocated 80% of the systems memory, something like 1.5gigs. I was surprised and kind of shocked that a small database made SQL Server allocate so much memory. I do understand that databases should grab as much memory as they can so they can do an efficient job of searching, but isn’t this a little overkill? I’ll post the code if you guys think it’s a problem on my end.
Sander
Sander
I don't know the internals of MSSQL Server, but I wouldn't be surprised or shocked by *anything* that it does.

Disclosure: Yes. I'm biased. I don't like MSSQL server.
MrRage
MrRage
The first Database I spent any serious time with was PostgreSQL, and after that experience I’ve been very disappointed with everything else out there. So I’m a little biased my self, and the only reason why I’m using MsSQL is because it was a system requirement – which I’m trying to have lifted but so far that’s not going to happen.
davepermen
davepermen
It's intended behavior and a good thing. Open up something on the server that needs a lot of ram (like "notepad.exe yourfavouritegigabytebigfile" :)) and you see that sql returns the ram immediately to any other exe that needs it.

Exchange server does the same, as does vista on everything.

What's the use of ram if you don't use it?
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
Kylotan
Kylotan
Linux does the same with file buffers. As long as memory is given back to whatever needs it most - where 'most' is obviously dependent on your particular needs - it's not an issue.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.