home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!apple!jdevries
- From: jdevries@Apple.COM (Jeff DeVries)
- Newsgroups: comp.unix.bsd
- Subject: [386BSD] Virtual memory paging not working?
- Message-ID: <76033@apple.apple.COM>
- Date: 1 Jan 93 00:53:16 GMT
- Distribution: usa
- Organization: Apple Computer Inc, Cupertino, CA
- Lines: 40
-
- I was using a program that displays the amount of memory in use after a
- garbage collection. Shortly after reaching slightly more than 6Meg, the
- program quit saying "Ran out of memory". I thought this was odd because
- even though I have 8Meg of real memory I also have a 16Meg swap partition,
- which means I should be able to get roughly 24Meg (right?). So...
-
- 1) I checked the disklabel and, yes, as0b was the swap partition and
- it was 16Meg (32k blocks).
-
- 2) I checked /etc/fstab and, yes, as0b was listed as the swap partition.
-
- 3) /etc/rc had a "swapon -a" command in it.
-
- 4) I tried to manually set swapon /dev/as0b and was told the device
- was already busy (which I took as a good sign that /etc/rc works).
-
- Since everything that I knew to look at seemed to be in order, I then
- tried the following little program:
-
- #define 4MEG 4000000L
- main()
- {
- int i;
- int *big = (int *) malloc(4MEG * sizeof(int)); /* should be 16Meg */
- if (! big)
- printf("oops!\n");
- else
- for (i = 0; i < 4MEG; i += 128) /* be nasty and hit every page */
- big[i] = i;
- }
-
- ... which printed "oops!"
-
- Is there something else I need to be doing to get virtual memory paging
- to work? Am I confused about what it should be doing?
-
- Any help would be appreciated!
-
- Jeff
- jdevries@apple.com
-