1

I have weblogic in Solaris 10 environment. My application had been caught OutOfMemoryError.

My question about killing bad build of application from shell script, not about tuning java or my code.

With Linux/BSD and Windows I can do pgrep for my particular application and do kill -SIGTERM and then kill -SIGKILL it. But on SunOS I can't pgrep them (ps(1) returns only first 80 symbols).

Does anybody know how to do it without drinking cup or too of coffee between redeploy?

Eir Nym
  • 1,515
  • 19
  • 30
  • 1
    ps -ef | grep java to see the application's pid then kill -9 – anfy2002us Jun 01 '11 at 11:59
  • Talking about application - do you want to kill the application that has been deployed in weblogic or the entire server? – Andreas Dolk Jun 01 '11 at 12:07
  • i mean application server, try ps -ef | grep java and u'll spot weblogic's process – anfy2002us Jun 01 '11 at 12:11
  • I need to kill only particular instance, not entire server. – Eir Nym Jun 01 '11 at 12:12
  • 1
    pgrep and pkill first appeared in Solaris and were later implemented in other OSes including Gnu/Linux. Can you clarify what precise version of Solaris you are using `cat /etc/release` that is missing pgrep ? I strongly doubt you are using SunOS 5.1 (Solaris 2.1). – jlliagre Jun 01 '11 at 12:22
  • pgrep is on place, but command lines are too long for it. Server release is Solaris 10 10/09 – Eir Nym Jun 01 '11 at 12:36
  • 1
    That should be SunOS 5.10, not 5.1 which was released in 1993 or so. Should you want more than 80 characters in ps output, you can use "/usr/ucb/ps -alxww". – jlliagre Jun 01 '11 at 13:42
  • Wow!!! It is exactly what I want! – Eir Nym Jun 01 '11 at 14:53
  • Okay, then I'll re post my comment as an answer. – jlliagre Jun 02 '11 at 23:00

2 Answers2

1

use the JVM parameter -XXexitOnOutOfMemory in case of a JRockit VM or use -XX:OnOutOfMemoryError="kill -9 %p" in case of a Sun JVM. This needs to be added to the start JVM args of the weblogic container.

Also see the Metalink note 1074735.1 for a listing on all of the nonstandard JVM options of JRockit JVM

BertNase
  • 2,374
  • 20
  • 24
1

Should you want more than 80 characters from ps output, you can use /usr/ucb/ps -alxww

jlliagre
  • 29,783
  • 6
  • 61
  • 72