* Summary: Pin an executable into Unix memory
@ 2000-06-16 17:03 Darryl Milczarek
0 siblings, 0 replies; only message in thread
From: Darryl Milczarek @ 2000-06-16 17:03 UTC (permalink / raw)
To: tru64-unix-managers
The gist of my question was: "Is it possible to load an executable into
memory in DEC Unix 4.0d so that it doesn't have to get read from disk
every time it executes?"
Many responses reverse the question and ask "WHY?"
Thanks to all who contributed. Their abridged comments follow:
Frank Wortner [frank@bondnet.com] The OS is designed to page in the
required portions of the image as it executes. Once those pages are in
memory, however, the read-only portions are shared between executing
processes running the same image. If the executables you mention are
used "hundreds of times a day," they probably are already mostly in memory.
Any pages that aren't are probably not used very much or often.
A good question to ask might be where is the "start up time" of the
executable spent? If a particular program needs to run lots of
initialization code before it can process any data, even locking it in
memory may not help, since the system overhead for starting it could be
very small in comparison.
Mlockall locks the *current* process's pages into memory. Once that process
exits or calls exec, the lock is cancelled. It *might* help -- if you have
the source of the program and can modify it to call this system call. By
forcing all the pages into memory, the next invocation of that executable
might get a break on startup costs, but that break might not be very much
improvement if the executable is heavily used. Chances are the required
pages would have been in memory anyway.
Alex Gorbachev [alex@iss-integration.com]
MFS (memory file system) would be one solution, see man mfs. Also,
increasing the nice value of a process (on Tru64 lower values correspond to
higher priorities) greatly reduces its chances of being swapped out. A -20
priority is Uninterruptible.
Nikola Milutinovic [Nikola.Milutinovic@ev.co.yu]
man chmod, look for a sticky bit "t"
Lars Bro [lbr@nettest.dk]
What you want is to make sure that the executable stays in memory BETWEEN
INVOCATIONS. There is no to do that but the second best is to have the
executable active all the time. Something like starting the program in the
background with a special option that locks its text portion into memory
and then sleeps forever. Then the text would be available for all subsequent
invocations.
Bob Vickers [bobv@dcs.rhbnc.ac.uk]
You may not have to do anything. If there is usually at least one copy of
the program being executed then it will reside in shared virtual memory
automatically.
Thanks to you all,
Darryl Milczarek
darryl.milczarek@emsusa.com
EMS 602 258-9114 ext. 220
Mobile 602 818-0020
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-06-16 17:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-16 17:03 Summary: Pin an executable into Unix memory Darryl Milczarek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox