# System not using swapspace

## gen2noob

It isn't freeing ram when I close stuff either, according to the KDE ctrl+alt+delete menu (even after clicking refresh).  Should any of this concern me and how do I activate my swap partition or tell if it is activated?  Swapon worked on the LIVEcd but it isn't working now...

Thanks all

----------

## moocha

If the swap partition line in /etc/fstab points to the correct hard drive partition, the only explanation I can think of is that you're using a kernel patch that discourages swap usage in favor of RAM usage (that isn't something bad as such). You didn't mention exactly what kernel you're running.

----------

## gen2noob

I am using the 'gentoo-dev-sources' kernel 2.6.10-r6.  The /etc/fstab looks OK too, so I'm really not too sure what the issue is.

----------

## moocha

Hm. Nevertheless, can you paste the output from 

```
grep swap /etc/fstab
```

 just in case?

----------

## syg00

 *gen2noob wrote:*   

> Should any of this concern me and how do I activate my swap partition or tell if it is activated?  Swapon worked on the LIVEcd but it isn't working now...

 

```
swapon -s
```

as described in the man page. If the monitor/display commands show a swap entry, I'd be most surprised to find it not activated.

----------

## gen2noob

 *Quote:*   

> bash-2.05b$ grep swap /etc/fstab
> 
> /dev/sda2               none            swap            sw                      0 0

 

Above is the output from grep swap /etc/fstab as per request.  It looks in accordance with the handbook, so I'm guessing I didn't mess up too bad.

mkswap /dev/sda2 and swapon /dev/sda2 (swapon worked after mkswap) didn't do anything to remedy the 0 usage problem...

The output from swapon -s:

 *Quote:*   

> 
> 
> bash-2.05b# swapon -s
> 
> Filename                                Type            Size    Used    Priority
> ...

 

The above problem(s) are that it is using 0 and that I don't have a SCSI hardrive, I have a SATA one.  I'm new at this but I really like gentoo and thanks all for the help.

----------

## syg00

 *gen2noob wrote:*   

> The above problem(s) are that it is using 0 and that I don't have a SCSI hardrive, I have a SATA one.  I'm new at this but I really like gentoo and thanks all for the help.

 

Have a look at this thread - Linux not using swap is not unusual.

As for S-ATA, it is implemented via the SCSI (code) interface. Re-use of code is good.      :Rolling Eyes: 

----------

## akkie

I am having weird problems as well. My applications get killed with the message out of memory while there's still more than enough swap available.

I know processes get killed if the system gets into trouble but shouldn't swap be filled first before deciding to kill my applications? What's going on?

I am using a kernel made from ck-sources 2.6.15-ck5. I have 256 MB memory.

```

uname -a

Linux bwl001 2.6.15-ck5 #4 Fri Mar 10 13:36:07 CET 2006 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz GenuineIntel GNU/Linux

free -m

             total       used       free     shared    buffers     cached

Mem:           241        231         10          0          5         44

-/+ buffers/cache:        180         60

Swap:          976         68        908

dmesg:

oom-killer: gfp_mask=0xd0, order=0

Mem-info:

DMA per-cpu:

cpu 0 hot: low 0, high 0, batch 1 used:0

cpu 0 cold: low 0, high 0, batch 1 used:0

DMA32 per-cpu: empty

Normal per-cpu:

cpu 0 hot: low 0, high 90, batch 15 used:8

cpu 0 cold: low 0, high 30, batch 7 used:23

HighMem per-cpu: empty

Free pages:        3084kB (0kB HighMem)

Active:30709 inactive:11688 dirty:0 writeback:201 unstable:0 free:771 slab:3191 mapped:41878 pagetables:339

DMA free:1060kB min:128kB low:160kB high:192kB lots:256kB active:10900kB inactive:20kB present:16384kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 231 231

DMA32 free:0kB min:0kB low:0kB high:0kB lots:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 231 231

Normal free:2024kB min:1880kB low:2348kB high:2820kB lots:3760kB active:111936kB inactive:46732kB present:237468kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0 0

HighMem free:0kB min:128kB low:128kB high:128kB lots:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0 0

DMA: 3*4kB 1*8kB 1*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 1060kB

DMA32: empty

Normal: 26*4kB 6*8kB 3*16kB 1*32kB 0*64kB 0*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 2024kB

HighMem: empty

Swap cache: add 40189, delete 32990, find 6390/9341, race 0+0

Free swap  = 914916kB

Total swap = 1000432kB

Free swap:       914916kB

63463 pages of RAM

0 pages of HIGHMEM

1656 reserved pages

55277 pages shared

7199 pages swap cached

0 pages dirty

201 pages writeback

41878 pages mapped

3191 pages slab

339 pages pagetables

Out of Memory: Killed process 6847 (soffice.bin).
```

----------

## Lorithar

 *akkie wrote:*   

> I am having weird problems as well. My applications get killed with the message out of memory while there's still more than enough swap available.
> 
> I am using a kernel made from ck-sources 2.6.15-ck5. I have 256 MB memory.
> 
> ```
> ...

 

  Very odd thing -- do you have selinux active? -- what shows:

```
 

ulimit -a

```

   for the user that was running soffice.bin

----------

## akkie

Thanks,

I'm not using selinux. ulimit shows max locked memory might be a problem? Most of the other values are unlimited.

How can I change these values as non-root user?

 *Quote:*   

>  ulimit -a
> 
> core file size          (blocks, -c) 0
> 
> data seg size           (kbytes, -d) unlimited
> ...

 

----------

