Re: newbie question about memory



On Fri, 27 Apr 2007 22:00:36 -0700, Sergei Shelukhin wrote:

Hi. I am a database prorgammer and I work on windows/MSSQL or with
small MySql databases 90% of the time, however on a project that is on
the way now, I have to use PostgreSQL on Linux; moreover, I need to
configure the server.

So, as I was figuring out the amount of memory on the server that I
can grab for db server operations, I stumbled upon an interesting
thing.
According to cat /proc/meminfo, I have 2 Gb of memory and 500Mb are
free.
Now the database is very big, but it's not operating it, so I was
surprised to see such a high memory use.
I checked ps -eo user,comm,%mem, and memory percents total to about
1.2% 0_o I see a lot of fancy labels in meminfo output, cached, etc,
but I cannot figure out what they mean and google seems
uncooperative :)

I have two questions
1) Where did the memory go?

No where. It's still there.

2) Can it be freed e.g. can I safely assume that I have 1-1.5Gb for
PostgreSQL to roam free?

Don't worry. Linux uses memory to cache everything for speedy response,
and leaves only a little "free" memory. The "used" memory will be
released, or reallocated, really, by the kernel, as needed, for apps and
data. It's the way Linux works.

Also, be sure to have a big enough swap partition just in case that
database really uses up all your RAM. Depending on how big the DB, the
swap should be equal to to twice RAM. Although I have heard of major
numbering crunching mathematical analysis guys going up to 4 time RAM for
the swap. However, for "normal" computing a 512 MB to 1 GB swap on a 2 GB
RAM machine is more than adequate. I have a 2 GB machine and 512 MB swap
that I doing professional level image processing on, and the swap is
rarely used at all.

Stef
.



Relevant Pages

  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.setup)
  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.misc)
  • Re: OT (slightly) swap limits
    ... influence your decision on how much swap was enough. ... processes due to lack of memory. ... I've run machines with 1Gig or more RAM with NO SWAP. ... Linux possible when before on Unix it wasn't? ...
    (Debian-User)
  • Re: advice for my new Linux workstation
    ... supports up to 16GB or ram be build today and would latest Debian Linux ... I would expect so (but pick any two from cheap, ... recommend the 64 bit kernel, though, as it manages that memory much ...
    (comp.os.linux.hardware)
  • Re: oom-killer vs system not reachable
    ... Do you think that Linux might stop to respond or get stuck ... Another situation is that several processes are competing for memory, ... in ram at once. ... is to monitor or log what happens when the system dies like this, ...
    (Debian-User)