home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / bsd / 10802 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.5 KB  |  51 lines

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