Re: Tracking down memory leaks



On Mar 21, 2007, at 1:17 PM, Don O'Neil wrote:
My setup seems to have a memory leak of some kind and I'm not sure how to
track it down....

When I first start up the system and all the processes start the machine has
1GB in free memory... After running for 20-30 minutes the free memory drops
to somewhere around 20MB... The longer it runs, the more it chews up free
memory until it eventually kernel panics and then reboots and the process
starts all over again.

I originally thought the reboot was from bad RAM, so I swapped it out, but
that didn't help. I ran a memory check and everything checks out ok.

Any ideas where to look (Hardware? Bad CPU? Software?). Temperature is ok,
lots of fans in the box and round cables so there is good air flow. I'm
stumpted.

It's normal for the amount of "free" memory reported by top to decrease to a small percentage of available physical RAM, as the system uses that memory to cache as much stuff from disk as possible. This does not necessarily mean that user processes are leaking memory-- to determine that, you'd need to look for processes which have their VSIZE grow without bounds over time (a period of hours or days is normally required, not minutes, although especially poorly written code might prove to be an exception). There are memory leak checkers in the ports which can help diagnose this situation such as valgrind, although I seriously wish for the system malloc to come with something like the "leaks" utility found in MacOS X.

It's not normal for the system to panic; this often indicates a hardware problem. But if you've done some hardware diagnostics & RAM tests, it might be a legitimate problem elsewhere. There are some brief suggestions in "man crash" and a chapter in the Handbook on how to diagnose and debug system panics.

--
-Chuck

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Random Restarts - Please Help
    ... I upgraded my BIOS a long time ago ... Beginners Guides: Diagnosing Bad Memory ... How to diagnose bad RAM ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Problems with IE after clean Install of Win XP & SP2
    ... I think hardware check may be my next step. ... The system is a Dell Dimension 8600, 232 GB hard drive, 1GB ram. ... Memory performace seems fine - Commit figures (Total=315 MG and Peak ... I* have only loaded Avast antivirus and MS Office 2003. ...
    (microsoft.public.windowsxp.general)
  • Re: Virtual Memory in use at 100%
    ... I just had a Hardware Malfunction again. ... I had to restart the server so I ... hardware problem but a software memory leak and they told me that the best ... > RAM compatibility, etc, can be the torture of anyone doing hardware/OS support. ...
    (microsoft.public.windows.server.sbs)
  • Re: Virtual Memory in use at 100%
    ... > well it could be the ram you had that went bad... ... > I just had a Hardware Malfunction again. ... I had to restart the server so I ... > hardware problem but a software memory leak and they told me that the best ...
    (microsoft.public.windows.server.sbs)
  • Re: XP not seeing 4 gb RAM
    ... By system, I was referring to system hardware, ie motherboard and its ... Your system allocates memory to various areas all of the time.. ... are in RAM available for programs, ...
    (microsoft.public.windowsxp.hardware)