Based on my own Q&A on Unix&Linux on a similar question.
As Stuart pointed out very well in his answer, valid values are integers in the range of -1000 to 1000 for
oom_score_adj. The lower the value, the lower the chance that it's going to be killed.
It's very inconvenient to have to change this value over and over again once you restart the application. The information is simply lost after the process has terminated. Upstart (the init daemon in Ubuntu), has a nice option for this to configure for daemons to make sure it's set whenever it has (re)started:
[...] snip [...]
# this application is a "resource hog"
oom score 1000
So, basically, you can edit the
/etc/init/myservice.conf configuration file for the services you like to change, to include a line
oom score -1000. I do assume that the services 'pbs' or 'gridengine' you're talking about in your question is Upstart-enabled, otherwise you'll need another way to change this permanently.