Finding Cause of Memory Leak

Hi

We have just got a dedicated server with Fasthosts, O/S is Linux CentOS 6 64 bit.

It was a fresh install and I have just moved one WordPress site onto there.

The problem is we seem to be getting a memory leak (that's what Fasthosts said) and the database (I think) keeps crashing, so we have to restart the server. Here's details of the issue that Fasthosts sent:

I don't really know how to go about trying to find the cause, my knowlege of UNIX is basic. I did check the mysqld.log file and there were lots of issues relating to the wp_options table, which became corrupt and I have to rebuild.

Any help much appreciated.

Thanks
Tom

You need more information than "they said" and "they think".

If you tried to post any details below where you said 'details', it didn't paste.

[edit] Okay, your picture is loading now. It doesn't show any more information than that it's out of memory though, it doesn't help explain why.

Do you have sar running on that server or anything like it?

Can you post the output of cat /proc/meminfo?

First you need to enable cores so that you can see what causes the crash (and be sure of the process that is crashing), as root

mkdir /cores
echo "/tmp/cores/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern

This will give you core file names that "just make sense(TM)"

Unfortunately the next step is a little complex, you need to run

gdb -c $core_file_name -e $path_to_named_executable_in_core

This will at least give you the reason for the crash
next run

gdb> bt -all

this will let you know what was happening at the time of the crash, however gdb is a bit arcane for someone whose knowledge of Linux is limited

Thanks for the replies.

Corona:
I've posted the output of meminfo below. I don't know what sar is, sorry.

Skrynesaver:
I've managed the first bit of your code, but you've lost me at step 2 sorry, I don't know what the core filename or path to executable are.

MemTotal: 3563324 kB
MemFree: 1827040 kB
Buffers: 53532 kB
Cached: 306200 kB
SwapCached: 0 kB
Active: 1404968 kB
Inactive: 150292 kB
Active(anon): 1195840 kB
Inactive(anon): 4724 kB
Active(file): 209128 kB
Inactive(file): 145568 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 4194288 kB
SwapFree: 4194288 kB
Dirty: 3588 kB
Writeback: 0 kB
AnonPages: 1195520 kB
Mapped: 33712 kB
Shmem: 5040 kB
Slab: 95536 kB
SReclaimable: 65852 kB
SUnreclaim: 29684 kB
KernelStack: 1360 kB
PageTables: 22760 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 5975948 kB
Committed_AS: 1752156 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 299972 kB
VmallocChunk: 34359434188 kB
HardwareCorrupted: 0 kB
AnonHugePages: 917504 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 8832 kB
DirectMap2M: 3821568 kB