-2

I used to have a LAMP/file headless server, running Ubuntu server 12.04 and 1 GB of RAM. It worked fine, with no problems for years.

When I moved to a new hardware with 4 GB and server 16.04, serving exactly the same services, my memory gets full with cache and I have a lot of swap usage.

Help me, resolve this isue.

memory leak screenshot

$ sudo lshw -C memory

*-firmware              
           description: BIOS
           vendor: American Megatrends Inc.
           physical id: 0
           version: P1.30
           date: 05/16/2014
           size: 64KiB
           capacity: 4032KiB
           capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification uefi
      *-cache:0
           description: L1 cache
           physical id: 5
           slot: L1-Cache
           size: 128KiB
           capacity: 128KiB
           capabilities: internal write-back unified
           configuration: level=1
      *-cache:1
           description: L2 cache
           physical id: 6
           slot: L2-Cache
           size: 1MiB
           capacity: 1MiB
           capabilities: internal varies data
           configuration: level=2
      *-memory
           description: System Memory
           physical id: a
           slot: System board or motherboard
           size: 4GiB
         *-bank:0
              description: DIMM DDR3 Synchronous 667 MHz (1.5 ns)
              product: M378B5673FH0-CH9
              vendor: Samsung
              physical id: 0
              serial: 83047B3B
              slot: A1_DIMM0
              size: 2GiB
              width: 64 bits
              clock: 667MHz (1.5ns)
         *-bank:1
              description: DIMM DDR3 Synchronous 667 MHz (1.5 ns)
              product: M378B5773CH0-CH9
              vendor: Samsung
              physical id: 1
              serial: 631A7A4F
              slot: A1_DIMM1
              size: 2GiB
              width: 64 bits
              clock: 667MHz (1.5ns)
  • Your screenshot looks kind of normal to me. What are you seeing that's cause for concern? – heynnema May 02 '17 at 14:05
  • With 3 GB free RAM I have 180 MB swap... when my server had only 1GB of RAM the swap was zero. Repeat again, with the same services.

    I just clean the swap, and made swapinness=0, and again, for several hours more than 100 MB swap, with NO load at all.

    Does not look normal to me at all.

    – Ivo Bogoev May 02 '17 at 19:59
  • You running 64-bit Ubuntu server 16.04? How many slots for RAM? How is it populated? show me sudo lshw -C memory. – heynnema May 02 '17 at 21:02
  • Yes 64 bit Ubuntu server – Ivo Bogoev May 03 '17 at 09:28
  • You didn't say how many memory slots you have, and your lshw indicates that it may be configured incorrectly. Tell me how many memory slots, and if the actual RAM sockets are colored... ie: some black, some white, or green, etc. And if they are colored, which colors contain RAM sticks. Or, if the RAM sockets are numbered J0, J1, J2, etc. – heynnema May 03 '17 at 12:54
  • The motherboiard has two slots, and they are busy with two sticks of RAM – Ivo Bogoev May 03 '17 at 13:07
  • Well then, you can't have a memory configuration problem. You might check that your BIOS is up to date. Otherwise, I'm out of ideas for you then. Sorry. – heynnema May 03 '17 at 13:09
  • By the way, the RAM I bought shold not be very good, because it is working in single channel mode. It is not a problem for me, because I do not need performance. Could this be connected to swaping? – Ivo Bogoev May 03 '17 at 13:12
  • Well that's what caught my eye... that it appeared to be working in single-channel mode. But if you've only got two slots... can't be fixed. Check your AMI BIOS. – heynnema May 03 '17 at 13:14

1 Answers1

0

Please take a look at the "swappiness value": How do I configure swappiness?

By the way, you used only 284M, the rest is cache: What Does Cached Memory Mean when Viewing htop?

  • Exactly...why the swap then. I tryed with swapinness=0, the same result... still have MBs of swap. And all this with no load.

    The new hardware is twice more powerfull than the old one, and has 4 time the RAM, still the swaping is worse.

    – Ivo Bogoev May 03 '17 at 13:04