Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Java program "debugging" itself... Date: Thu, 2 Jun 2016 14:17:12 -0000 (UTC) Organization: A noiseless patient Spider Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 2 Jun 2016 14:17:12 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="25578"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zs9E0NxiLdWVsH0WdYsxDJzN+lMEmciM=" User-Agent: Pan/0.140 (Chocolate Salty Balls; GIT 3663720 git://git.gnome.org/pan2) Cancel-Lock: sha1:K9pBuTTQrzFr7jI7n5a6BQRwBfM= Xref: csiph.com comp.lang.java.programmer:34439 On Thu, 02 Jun 2016 13:36:37 +0000, Andreas Leitgeb wrote: > My application is a server that runs separate tasks as requested by > clients. > > Rarely it happens, that one of the tasks goes awry, due to some bug in > the task's code itself. Latest incident was a loop that accidentally > didn't terminate but grew a StringBuilder's buffer beyond any bounds. > Are these tasks running in their own address space or are they sharing an address space with your server and its other children? If the former is the case, can you use the -Xmx command line option to trap and kill off the misbehaving task? In the past I've had the opposite effect when bulk loading data into a Postgres database on a Linux system: my Java application, when run on a smaller system than I have now, kept being killed off, initially when it exceeded the -Xmx default value and then several more times until I finally got an -Xmx setting that was big enough to let it run to completion. My current system has 8 times the memory and the so the default -Xmx setting is now big enough not to interfere. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |