home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / wizards / 3830 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.6 KB

  1. Xref: sparky comp.unix.wizards:3830 comp.sys.sun.misc:4114
  2. Path: sparky!uunet!igor!twinkie!drk
  3. From: drk@twinkie.Rational.COM (David Kaelbling)
  4. Newsgroups: comp.unix.wizards,comp.sys.sun.misc
  5. Subject: Reducing "reserved" swap space?
  6. Keywords: SunOS, shared libraries, swap
  7. Message-ID: <5672@igor.Rational.COM>
  8. Date: 7 Sep 92 17:44:23 GMT
  9. Sender: news@Rational.COM
  10. Followup-To: poster
  11. Lines: 26
  12.  
  13.  
  14. Can anybody explain what exactly determines the "reserved" swap space
  15. allocated by a program, and how I can reduce this number?
  16.  
  17. I have a large application (running on Sun-4's under SunOS 4.1.x), and
  18. want to have several copies of the application running concurrently.
  19. Currently the swap space requirements are a major obstacle.  According
  20. to "pstat -s" each copy of the application allocates 1.5Mb of swap and
  21. reserves 9.4Mb.  Purify reports that the heap is around 3.5 Mb.  To
  22. the untrained eye it appears that swap space is reserved for the
  23. entire text segment (size reports 6430kb text, 876kb data, 29kb bss),
  24. but never used.  How can I eliminate or amortize this waste?
  25.  
  26. I put most of the code into shared libraries; they help but add 20
  27. seconds to the startup time of the application, which is unacceptable.
  28.  
  29. I tried "ld -n"; that just moved 6.5Mb from reserved to allocated.
  30.  
  31. I tried setting the sticky bit (as root, since doing it normally fails
  32. silently); swap space requirements were unchanged.
  33.  
  34. I've searched through many TFM's to no avail.  The bulk of the code is
  35. compiled with -PIC already (a relic of shared libraries).
  36. --
  37. David Kaelbling                            (508) 520-8632 [home -7826]
  38. 12 Mountain Rock Ln.; Norfolk, MA 02056-1772   DKaelbling@Rational.COM
  39.