LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Inactive memory issue, Freebsd (memory leak?) (http://www.linuxquestions.org/questions/%2Absd-17/inactive-memory-issue-freebsd-memory-leak-661965/)

JasperB 08-11-2008 06:36 AM

Inactive memory issue, Freebsd (memory leak?)
 
I'm running pfsense firewall on freebsd and I'm having the following problem.

This is the memory usage :

Code:

$ top
last pid: 48536;  load averages:  0.02,  0.03,  0.08  up 2+16:18:30    12:16:31
96 processes:  1 running, 90 sleeping, 5 zombie

Mem: 78M Active, 1503M Inact, 160M Wired, 112M Buf, 260M Free
Swap: 2048M Total, 2048M Free


  PID USERNAME  THR PRI NICE  SIZE    RES STATE    TIME  WCPU COMMAND
  511 root        1  -8    0 24388K 23164K piperd  0:28  0.78% php
 1047 proxy      19  20    0 36012K 32960K kserel  3:00  0.00% squid
  672 root        1  96    0  6388K  6144K select  0:57  0.00% bsnmpd
  729 root        1  8  20  1932K  1372K wait    0:38  0.00% sh
 1158 zabbix      1  8    5  2592K  1292K nanslp  0:14  0.00% zabbix_agentd
  491 root        1  4    0  3724K  2792K kqread  0:08  0.00% lighttpd
  200 root        1  96    0  1468K  1104K select  0:05  0.00% syslogd
  313 root        1 -58    0  4240K  2532K bpf      0:04  0.00% tcpdump
24045 root        1 -58    0  4100K  2052K bpf      0:04  0.00% bandwidthd

For some reason, all the memory is being put into the Inactive memory.

Right now it only has 70mb of free mem and about 1600mb in inactive. Shouldn't it take some out of inactive and put it in free?

Does this have something to do with a program like NTOP not working properly?

Also see this screenshot for PHPMYSYSinfo.

http://www.xs4all.nl/~jsbosch/pfsense/14.JPG

Is this normal?? When I reboot the firewall the problem is gone and I have a bunch of memory free.

Is this normal? Or is it caused by a mailfunctioning program? Shouldn't it " scrub " the memory which is in inactive?

chort 08-11-2008 08:43 AM

You're not using any swap, so the system is not actually "running out" of memory. If it needs to allocate more, it will reclaim inactive memory to do so.

While PHP and Squid have a lot of memory assigned, the system isn't taxed at all for load, so I'm not seeing any problem...

JasperB 08-11-2008 09:47 AM

So is it normal that it reserves so much memory in the inactive mem part?

It only has 2mb of physical memory free at the moment and the swap still is not being used.

If I reboot the inactive memory isn't being used I believe, so could it be using it now due to a leaking memory proces?

chort 08-11-2008 10:54 AM

Like I said, if it starts using swap, then you know you have a memory leak. Modern operating systems try to make the most of your RAM by heavily utilizing caching to minimize pulling information off disk. What good is 2GB of RAM if you're only using 400MB and you keep having to go out to disk to read information?

JasperB 08-12-2008 01:46 AM

It seems to be using swap now, why is it not using the " buffered" inactive memory?

chort 08-12-2008 03:04 AM

Likely there is a problem with one of the PHP applications, then. What's the output of
Code:

ps auxm
?

JasperB 08-12-2008 03:10 AM

http://rafb.net/p/JBA8vI17.html

chort 08-12-2008 03:19 AM

As expected there are some fairly large PHP processes, but what the heck is "/usr/local/sbin/imspector" and why are there so friggin many of them? That might be a good place to start.


All times are GMT -5. The time now is 09:17 AM.