dbTalk Databases Forums  

[BUGS] memory does not return back

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] memory does not return back in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
hessam
 
Posts: n/a

Default [BUGS] memory does not return back - 02-17-2004 , 12:26 PM






I'm using freeradius 0.9.3 with postgresql 7.3.2.
All I do is just inserting some h323 accounting data into my tables.
After a couple of hours the memory reaches to about 1G and then Linux
starts using swap file.I lose some of my records and PC becomes very
slow.
Even if I restart postgresql , the memory does not return back.
I've ordered another 1Gb RAM.Is it really necessary?
When I reboot Linux and start Postgresql momory usage is about 250 Mb.
Even a single select from a large table which lasts more than a minute
causes this.
I'm using Pentium 4 (2.6 GHZ) , 1 GB RAM, 80Gb HDD.
PostgreSQL 7.3.2 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-
linux-gcc (GCC) 3.2.2 20030213 (Red Hat Linux 8.0 3.2.2-1).
Just a couple of days ago I ordered Intel PC with two Xeon CPUs and 1
GB RAM(soon would be 2GB) and installed Linux(9) on it same as above.
Selects are faster But again RAM usage reaches about 1GB and it's using
swap , cpu cache.Restarting Postgresql does not help.
What am I to do now?


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] memory does not return back - 02-17-2004 , 02:08 PM






On Tuesday 17 February 2004 12:03, hessam wrote:
Quote:
I'm using freeradius 0.9.3 with postgresql 7.3.2.
All I do is just inserting some h323 accounting data into my tables.
After a couple of hours the memory reaches to about 1G and then Linux
starts using swap file.I lose some of my records and PC becomes very
slow.
Even if I restart postgresql , the memory does not return back.
Which would suggest perhaps that postgresql might not be the problem here. Can
you provide output from ps/top showing memory usage for the key processes
involved here?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #3  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] memory does not return back - 02-18-2004 , 03:30 AM



On Wednesday 18 February 2004 05:54, hessam wrote:
Quote:
Dear Richard,

Thank you for your reply.Below are results of ps and top commands on
my new linux Box:

There are 64 database connection made by freeradius.When I reboot my
machine with 'chkconfig postgresql off' 'chkconfig radiusd off' .
nothing happens and everything is normal.Then I just start postgresql
and do "select * form mytable;" memory goes up . The more select I do
from different table, the more memory usage becomes.(whithout
freeradius).And memory does not return back,but when I restart
postgresql it goes down from 1GB to about 300Mb at the begining but
after just minutes it reaches the top.Then I reboot linux with
postgresql at the begining it is about 200 Mb but it takes hours to
reach 1GB.
I see no evidence of high memory usage in the trace below - indeed the largest
memory usage is by the RedHat network config applet. If you look at the
figures, you have 144028KB used for buffering (144MB) and 960924KB for file
cache (960MB) along with 0 swap used.

Quote:
08:56:26 up 18:51, 3 users, load average: 0.01, 0.02, 0.00
133 processes: 132 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 1.0% user 2.0% system 0.0% nice 0.0% iowait
96.3% idle
CPU1 states: 1.0% user 1.1% system 0.0% nice 0.0% iowait
97.2% idle
Mem: 2064420k av, 1512876k used, 551544k free, 0k shrd,
144028k buff
495576k actv, 377752k in_d, 369380k in_c
Swap: 2040244k av, 0k used, 2040244k free
960924k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU
COMMAND
2514 root 15 0 4000 4000 1340 S 1.3 0.1 2:48 0
radiusd
3089 root 15 0 6092 6088 5060 S 1.3 0.2 13:00 1
magicdev
18985 root 16 0 1184 1184 856 R 0.7 0.0 0:00 0 top
2365 root 15 0 2972 2972 1436 S 0.3 0.1 0:08 0 cupsd
2599 postgres 15 0 5208 5208 3984 S 0.3 0.2 0:04 0
postmaster
2609 postgres 15 0 5196 5196 3992 S 0.3 0.2 0:04 0
postmaster
2718 root 16 0 1200 1200 856 S 0.3 0.0 3:39 1 top
3096 root 15 0 13408 13M 8704 S 0.3 0.6 10:27 1 rhn-
applet-gu
[snip]

You do know that the "1512876k used" includes all this buffer/cache memory and
isn't really "in use"? If not, do some searching on Google for terms like
"linux out of memory buffer cache" - it confuses everybody the first time
they come across it.

Tip: try "free -m"
$ free -m
total used free shared buffers cached
Mem: 975 213 761 0 12 101
-/+ buffers/cache: 99 875
Swap: 1027 0 1027
Here the important values are on the second line - 99MB used, 875MB free.

If you still think there is a problem, can you show the output of "top" when
your system's memory usage increases. Tip: press "M" (not "m") to sort the
output by memory usage.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.