0
  • Redhat Linux Enterprise Server 5.10 (I know it's old, I can't change that)
  • This machine is virtualized using VMTools.
  • Total memory for this VM: 32GB. Total disk swap space (virtual memory): 36GB. 900GB left on main drive.
  • Terminal is Hummingbird Exceed v14 on Windows 7. (I can't change either of these.)
  • I'm not a real sysadmin, I just program on the machine. So more detailed instructions would be helpful, like where the logs are and what to grep for.

When I'm running a certain program reading 7000 lines from a spreadsheet (which is not that big), sometimes my process will just be killed and the terminal disappears.

  • What are some reasons the OS might kill my process?
  • The physical server this VM resides on was really busy yesterday, who knows how much memory the other VMs on this server were using, but shouldn't my 32GB of memory be reserved just for my VM?
  • Would VMTOOLS look at all virtual machines when memory gets low and pick random VMs and random resource hogs to kill? (My process was using 95-99% of CPU time, but again, I thought that was just for my VM.)

Thanks. I'm really stuck here.


EDIT 1: I checked /var/log/syslog and ignored several types of lines using grep -v and what I saw that when I was kicked off, each time it looks like some resource-greedy cron jobs were running. I think that is what happened.

Now my question is, now can I limit the memory and swap space these cron jobs use, so the memory is not used up and my terminal doesn't get killed? Is there something I can do at the OS level?


EDIT 12/7/2017: After further investigation with top, we are nowhere close to using up memory, swap space, or hard drive space. So something else is going on, and IT is looking into it.

  • 2
    Do you see OOM (out-of-memory) messages in the logs? – mattdm Nov 30 '17 at 15:44
  • Could be that the process reached a limit set with ulimit. – Raman Sailopal Nov 30 '17 at 15:46
  • Which process is "my process"? The host process providing the X server or terminal emulator? The guest process reading from the spreadsheet? – JdeBP Nov 30 '17 at 15:56
  • 2
    So you are asking why the operating system killed your process and what to do about it, without determining what process was actually killed in the first place. You say that the "terminal disappears", but then you say that some other process, not the terminal emulator process, is the one being killed. I suggest before asking for what to do, that you determine what actually is happening in the first place, by looking to see what of your processes are still running and what processes are not, on host and guest. – JdeBP Nov 30 '17 at 16:40
  • 1
    The typical reason for a kernel to close your application is that you do not have enough memory. A complicated subsystem called oom-killer will then choose which process to kill, often the last one grabbing too much RAM but not always. In all cases your system logfiles should give you more explanations, have a look at /var/log/kern.log or /var/log/syslog or similar. – Patrick Mevzek Nov 30 '17 at 17:06
1

Now my question is, now can I limit the memory and swap space these cron jobs use, so the memory is not used up and my terminal doesn't get killed? Is there something I can do at the OS level?

Yes. Read carefully setrlimit(2). You want to use the ulimit bash builtin appropriately.

Be aware of memory overcommitment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.