home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.admin
- Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!jimbys
- From: jimbys@cco.caltech.edu (James V. Bys)
- Subject: How to GLOBALLY reduce data size?
- Message-ID: <1992Sep3.045851.10665@cco.caltech.edu>
- Summary: How can the default process data segment size be reduced globally?
- Keywords: data segment kernel patch
- Sender: news@cco.caltech.edu
- Nntp-Posting-Host: plug
- Organization: California Institute of Technology, Pasadena
- Date: Thu, 3 Sep 1992 04:58:51 GMT
- Lines: 74
-
- The default data segment size for most Suns is a little less than 512
- Megabytes. It seems unfair for one process to use up this much virtual memory,
- especially when the system in question is running as a server.
-
- If the assumption is correct that one process can grab 512 MBs of virtual
- memory, then the question is how can the default limit be lowered
- system wide?
-
- (This question also has a further assumption that most programs will be
- reluctant to raise their default limit. If this is not true the following
- comments still apply to lowering the maximum limit.)
-
- The "setrlimit" system call applies only to the process that calls it and its
- children.
-
- There therefore appears to be only a few ways to enforce a new default
- data size:
-
- 1) Reconfigure the kernel to have a new default size.
-
- 2) Change the code for the init process (the father of all processes, right?)
- to call setrlimit.
-
- 3) Change all allowable shells in /etc/shells, and all daemons that will
- cause new processes to be formed to call setrlimit.
-
- The only option that seems feasible without source is number 1).
-
- But...
-
- Here is what has been tried in building a new kernel:
-
- The file vmparam.h in /sys/k-arch was modified for the new reduced limit and
- the kernel rebuilt.
-
- Apparently the code that would be affected by vmparam.h is precompiled,
- however.
-
- That code appears to be in machdep.o (at least the symbols _dfldsiz and
- _maxdsiz are defined there).
-
- Sun technical support suggested patching vmunix to put a new value in
- _dfldsiz using adb but it appears that the contents of _dfldsiz does not
- exist in the "vmunix" file.
-
- _dfldsiz is accessible in the running kernel but then the new value would
- have to be patched every time the system is rebooted.
-
- In the running kernel _dfldsiz can be examined only in memory (/ command
- to adb, not ?).
-
- This might make sense if _dfldsiz is not a static and a value is loaded
- into it only when the system is running.
-
- It might also be that I just don't know how to find where its static value
- is stored in vmunix.
-
- Tech support's suggestion was to use the command
-
- _dfldsiz/W <new-hex-value>
-
- in adb to modify vmunix. But would this command not just modify memory?
-
- Now I know next to nothing about running adb so it is possible that some
- other commands to adb would have been successful.
-
- An attempt was also made to search for the 32 bit value "1fffe000"
- (the normal default data size value) in vmunix and machdep.o without success.
-
- Any help here would be appreciated. Please point out any misguided assumptions
- and other methods for reducing the default size globally.
-
- James V. Bys
- E-mail address: jimbys@cco.caltech.edu
-