Subject: VM problems
To: None <current-users@NetBSD.ORG>
From: Craig M. Chase <chase@pine.ece.utexas.edu>
List: current-users
Date: 07/27/1995 16:29:47
Hello,

I can't seem to get my NetBSD-current kernel to swap/page.
The kernel is current as of 7/26 (supped on 7/27).
I have over 100 Meg of swap space, but I can't seem to use any of it.

Here's the story.  The following program runs out of VM

#include <stdio.h>

main(int argc, char** argv)
{
	char* p; char* s; char *e;
	p = malloc(1024*1024*atoi(argv[1]));
	if (!p) {
	    fprintf(stderr, "no memory\n");
	    exit(-1);
	}
	while (1) {
	    s = p; e = p + 1024*1024*atoi(argv[1]);
	    while (s < e) *s++ = *p;
	}
	    
}

synopsis:
chase@marvin>foo 8 &
[1] 392
chase@marvin>ps xu
USER       PID %CPU %MEM   VSZ  RSS TT  STAT STARTED       TIME COMMAND
chase      392 69.9 25.6  8208 8392 p2  R     4:20PM    0:03.66 foo 8 

(works fine consuming only 8 meg)

But note:

chase@marvin>pstat -s
Device      512-blocks     Used    Avail Capacity  Type
/dev/wd0b       262080    20680   241400     8%    Interleaved
chase@marvin>foo 16
no memory

I have 32Meg of physical RAM in the machine, here's the disktab (in
case that is relevant)

Any suggestions on what I could have done wrong?  I'd be happy to
provide the kernel config to anyone curious enough to want to see it.

Thanks!

Craig


type: ST506
disk: maxtor7546a
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 1060
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

6 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:    40320   205632    4.2BSD     1024  8192    16   # (Cyl.  204 - 243)
  b:   262080   245952      swap                        # (Cyl.  244 - 503)
  c:   862848   205632    unused        0     0         # (Cyl.  204 - 1059)
  d:  1068480        0    unused        0     0         # (Cyl.    0 - 1059)
  e:   560448   508032    4.2BSD     1024  8192    16   # (Cyl.  504 - 1059)
  f:   205569       63     MSDOS                        # (Cyl.    0*- 203*)

-- 
Craig Chase --- Assistant Professor
Electrical and Computer Engineering
The University of Texas at Austin
Austin, TX 78721   --- (512) 471-7457