1

On Ubuntu 12.04/Java 1.7

I have been reading/searching about OOM killer and generally understood what "proc" man page says especially oom_adj part. It all started because my important "MQ listeners" are getting killed.

We have a master listener process that listens for MQ messages and spawns a new job using same jar file, different command line arguments. It uses Runtime.getRuntime().exec to fire the job.

Whole thing is ran as a very low privileged user - a user that does not have any other permissions.

My concern is OOM score for the listener process keeps increasing because it keeps spawning the process and eventually gets killed assuming that java exec call uses fork internally.

  1. How do I change oom_adj value for a process fired by low privileged user? Otherwise it will mean that all folks who can deploy the jar file need to have sudo permissions.

  2. Is there any call/file I can use to get OOM scores of all jobs to find out which one is likely to be killed? Looking for report similar to what get logged in syslog file but without actually killing the jobs

user871199
  • 185
  • 5

1 Answers1

0

Using oom_score_ajk to fix this problem is a bad way to go about it. Even if you adjust the OOM score, something will get killed, and eventually it will be something you don't want to die (either the MQ listener or a core system service like syslog/cron).

The reliable solution to your problem is to either get more memory (RAM + swap) or reduce the memory usage of your application.

Alex J
  • 2,804
  • 2
  • 21
  • 24
  • There was a bug that caused more processes to be fired than box capacity. We have swap and have done capacity calculations and listener throttles the job. However, since bugs are part of the life, I am looking for a solution for the future so that listener won't go down. If things become worst, we are ok if individual jobs get killed and can adjust score for them. – user871199 Nov 12 '15 at 19:54