1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Memory leak

Discussion in 'General' started by Keshkins, Mar 31, 2009.

  1. Keshkins

    Keshkins New Member

    Messages:
    3
    Likes Received:
    0
    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.
     
  2. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,359
    Likes Received:
    0
    Do note that the free memory will get used for file caching.
     
  3. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,622
    Likes Received:
    2
    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:
    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.
     
  4. Keshkins

    Keshkins New Member

    Messages:
    3
    Likes Received:
    0
    Current state is

    Code:
    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.
     
  5. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,622
    Likes Received:
    2
    This is entirely normal. Don't worry.
     
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,359
    Likes Received:
    0
    You can keep an eye on it with the vmstat command.
     
  7. Keshkins

    Keshkins New Member

    Messages:
    3
    Likes Received:
    0
    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.
     
  8. Djn

    Djn New Member

    Messages:
    392
    Likes Received:
    0
    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.)
     
  9. gordon@

    gordon@ New Member Developer

    Messages:
    404
    Likes Received:
    0
    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.
     
  10. Carpetsmoker

    Carpetsmoker New Member

    Messages:
    919
    Likes Received:
    0
    I think it would be more correct to say that ``XP is absolutely horrible at managing RAM , and Vista is slightly better''
    </OtRant>