/>
- Joe, this is Clay Kroh. You're process timeRandomArray has been running for days and is using a LOT of CPU! Did you know that? - Sorry, Clay - didn't know it was still running!! WHOOPS!!
.profile -------- # This is the default standard profile provided to a user. # They are expected to edit it to meet their own needs. MAIL=/usr/mail/${LOGNAME:?} PS1=`uname -n`"|"'$PWD$ ' export PS1 # set -o vi # alias to create simpler commands alias pri='cd ~/private' alias pub='cd ~/public_html' alias code='cd ~/private/' alias web='cd ~/public_html/' alias courses='cd ~/courses' alias who='who -HT' alias h='history' alias lss='ls -la' alias big='du -k | sort -n' alias dum='od -ct x1' # alias du='od -ct x1 -d' # alias du='od -x' alias 11001='cd ~/courses/class_cis11001' alias 16301='cd ~/courses/class_cis16301' alias 16302='cd ~/courses/class_cis16302' alias 20201='cd ~/courses/class_cis20201' alias 20202='cd ~/courses/class_cis20202' alias 24401='cd ~/courses/class_cis24401' alias 25301='cd ~/courses/class_cis25301' alias 30001='cd ~/courses/class_cis30001' alias 35001='cd ~/courses/class_cis35001' alias 35501='cd ~/courses/class_cis35501' alias findf='find . -name $1' alias up='cd ..' alias aux='cd ~/aux' alias mult='cd ~/multimedia' alias top='/usr/local/bin/top' alias sudo='/usr/local/bin/sudo /usr/bin/chmod 644' alias myps='ps -ef | grep wyatt' # The next lines added for C++ compiles, man pages # and also to add current directory to the path PATH=/opt/SUNWspro/bin${PATH:+:}${PATH} MANPATH=/opt/SUNWspro/man:${MANPATH:=/usr/share/man} PATH=$PATH:. export PATH export MANPATH # The next lines display information about my acct echo " " echo "============== TODAY IS=================" date echo " " echo "============== MY ALIAS LIST============" alias echo " " echo "============== MY DISK QUOTA============" quota -v echo " " echo "============== MY PROCESSES=============" ps -ef | grep wyatt echo " " # goto code dir cd ~/private
For the past 3 days I haven't been able to access Jupiter via telnet or putty. I've tried getting on from my personal computer and from a computer in becker lab. I keep getting: bash: fork: resource temporarily unavailable bash-2.03 Resource temporarily unavailable ================================ This indicates that the fork(2) system call failed because the system's process table is full, or that a system call failed because of insufficient memory or swap space. It is also possible that a user is not allowed to create anymore processes. Simply waiting often gives the system time to free resources. If one user is not allowed to create any more processes, that user has probably exceeded the memorysize limit; see the limit man page for details. The symbolic name for this error is EAGAIN, errno=11.
Somehow he had 99 of these processes running: s_refets 25790 1 0 Oct 27 ? 0:00 kidsb s_refets 25768 1 0 Oct 27 ? 0:00 kidsb jupiter|/superuser# ps -ef|grep s_refets|wc -l 99 I killed them and he should be okay now.
He said this was his code: ?? #include <iostream.h> #include <unistd.h> #include <fstream.h> #include <iomanip.h> using namespace std; int main() { int child = 0; ofstream output; output.open("xx.dat"); for (int i = 0; i<5; i++) { child = fork(); if (child == 0) { cout << getppid() << endl; for (int j = 0; j < 5; j++) output << getpid() << endl; break; } } output.close(); return 0; }
The break statement terminates the execution of the nearest enclosing loop or conditional statement in which it appears. ^^^^ ========================================================================= The break command allows you to terminate and exit a loop (that is, do, for, and while) or switch command from any point other than the logical end. You can place a break command only in the body of a looping command or in the body of a switch command. It terminates the loop or switch. Where switch and loop statements are nested, break exits the innermost one containing it. To search for the first zero in the array my_ints: int index; for (index=0; index<10; index++) if (!my_ints[index]) break; if (index == 10) cout << "no zeros" << endl; else cout << "first zero is at " << index << endl;
PID: 1317 PPID: 1314 PID: 1318 PPID: 1314 PID: 1318 PPID: 1314 PID: 1318 PPID: 1314 PID: 1318 PPID: 1314 PID: 1318 PPID: 1314 PID: 1319 PPID: 1314 PID: 1319 PPID: 1314 PID: 1319 PPID: 1 PID: 1319 PPID: 1 PID: 1319 PPID: 1 A process whose parent dies, becomes a zombie and is adopted by the process, init, whose pid is 1. When a program forks and the child finishes before the parent, the OS keeps some information about the child in case the parent may needs-- for example, the parent may need the child's exit status. To do this, the parent calls wait(); and the kernel can discard the information. In the interval between the child terminating and the parent calling wait(), the child is called a `zombie'. Even though it's not running, it's still taking up an entry in the process table. The process table has a fixed number of entries and it is possible to run out of them. There's a limit on the # of processes a user can run, which is smaller than the system's limit. This is why you should always check if fork() failed! If the parent terminates without calling wait(), the child is 'adopted' by init, which cleans up after the child. (This is a special system program with process ID 1 -- it's the first program to run after the system boots).