Memory leak

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Memory leak

Postby Keshkins » 31 Mar 2009, 10:39

My server freebsd has growing Active memory. It fills all the 3Gb in a day, ps statistics by process show that processes all together take about 1Gb.

What could it be? Where does the memory go?

Version is 7.1 upgraded from 6.1 with compat6x.
Services: nginx,apache22,mysql41,php,perl,munin

Thanks in advance.
Keshkins
Junior Member
 
Posts: 3
Joined: 31 Mar 2009, 10:34

Postby SirDice » 31 Mar 2009, 11:16

Do note that the free memory will get used for file caching.
User avatar
SirDice
Old Fart
 
Posts: 16196
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby DutchDaemon » 31 Mar 2009, 11:20

Do you ever run out of memory, or are you using a lot of swap? FreeBSD tends to reserve/preallocate almost all available memory, but it will always leave some free. For example, on a 1,25 GB RAM system, something like this is entirely normal:

Code: Select all
Mem: 873M Active, 93M Inact, 241M Wired, 31M Cache, 112M Buf, 9232K Free


My system requires nowhere near this amount of RAM at the moment, but FreeBSD will just keep it 'under its wings'. Indeed, for caching purposes.
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby Keshkins » 31 Mar 2009, 11:28

Current state is

Code: Select all
up 0+16:15:17
Mem: 2461M Active, 649M Inact, 212M Wired, 127M Cache, 112M Buf, 59M Free
Swap: 4071M Total, 36K Used, 4071M Free


I haven't yet tested it for swap, i'll wait longer and make a post with results.
Keshkins
Junior Member
 
Posts: 3
Joined: 31 Mar 2009, 10:34

Postby DutchDaemon » 31 Mar 2009, 11:33

This is entirely normal. Don't worry.
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby SirDice » 31 Mar 2009, 11:57

Keshkins wrote:I haven't yet tested it for swap, i'll wait longer and make a post with results.


You can keep an eye on it with the vmstat command.
User avatar
SirDice
Old Fart
 
Posts: 16196
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby Keshkins » 31 Mar 2009, 21:03

Thanks to everyone :)
I am just a little bit paranoid :)
When it reached 2,9 Gb, system transfered 1,5 G to inactive memory.
Swap was not even touched.
Keshkins
Junior Member
 
Posts: 3
Joined: 31 Mar 2009, 10:34

Postby Djn » 31 Mar 2009, 22:12

On a random note, this closely mirrors some reactions to Vista. :)
(It's better at using spare RAM for buffering than XP was, leading to exactly the same apparent issue.)
Djn
Member
 
Posts: 392
Joined: 19 Nov 2008, 14:21
Location: Horten, Norway

Postby gordon@ » 01 Apr 2009, 06:36

Be aware that FreeBSD doesn't even start tracking active vs inactive memory until it actually needs to. If there are boat loads of free memory, it doesn't bother tracking it. When there is memory pressure, then it'll track, classify and finally swap.
gordon@
Member
 
Posts: 404
Joined: 20 Feb 2008, 22:44
Location: San Diego, CA

Postby Carpetsmoker » 01 Apr 2009, 22:46

Djn wrote:On a random note, this closely mirrors some reactions to Vista. :)
(It's better at using spare RAM for buffering than XP was, leading to exactly the same apparent issue.)


I think it would be more correct to say that ``XP is absolutely horrible at managing RAM , and Vista is slightly better''
</OtRant>
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
User avatar
Carpetsmoker
Member
 
Posts: 905
Joined: 16 Nov 2008, 19:07
Location: Eindhoven, Netherlands


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest