Linux Virtual Memory/Swap isn't being used

1

I think my virtual memory is not configured correctly on my MintLinux machine. I opened up a new IDE, IntelliJ IDEA, and my whole system appeared to freeze. I tried to TTL to the console but that did nothing, at first. So I used my phone to SSH into it. However, that also took forever and the machine switched to TTL1 while I was waiting for my phone to log in.

When I ran "top" it showed that I was using all my RAM. But what seemed weird to me was that 0 swap was being used and the total available is 0. The machine was responding, albeit very slow. I killed some other applications, firefox, banshee and a few others but left the IDE untouched to see if it had a memory leak or bug. It didn't. Once I freed up the memory it started to function normally.

I don't think it was the IDE but rather it was the application that happened to use up the last of my RAM. I checked my fstub file, it's pointing to the swap partition of another distro I tried (Debain). That might be the issue?

top:

Tasks: 254 total,   1 running, 252 sleeping,   0 stopped,   1 zombie
Cpu(s): 22.0%us,  8.5%sy,  0.2%ni, 67.6%id,  1.8%wa,  0.0%hi,  0.0%si,  0.0
Mem:   4058176k total,  3490428k used,   567748k free,    48124k buffers
Swap:        0k total,        0k used,        0k free,   794636k cached

vmstat:

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 523736  50088 797544    0    0   893    30    1   26 11  4 81  4

fdisk -l:

Disk /dev/sda: 240.0 GB, 239997026304 bytes
255 heads, 63 sectors/track, 29177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000a3c7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       24002   192794784   83  Linux
/dev/sda3           24003       24263     2093056   82  Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004ffe5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       60301   484360192   83  Linux
/dev/sdb2           60301       60802     4022273    5  Extended
/dev/sdb5           60301       60802     4022272   82  Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

/etc/fstub:

proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/sda1       /               ext4    errors=remount-ro 0       1
/dev/sda5       none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

Alan B. Dee

Posted 2011-09-28T01:53:19.107

Reputation: 167

Answers

2

Your fstab says "sda5", but you have no sda5. Allowing multiple distros to share swap is not a problem as long as you can't switch after hibernation.

Ignacio Vazquez-Abrams

Posted 2011-09-28T01:53:19.107

Reputation: 100 516

Ah, I didn't make the distinction between sbd5 and sda5. All I needed was another pair of eyes. Thanks. – Alan B. Dee – 2011-09-28T02:20:28.917