This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: serverside programs
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Erik Poupaert <erik dot poupaert at skynet dot be>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 17 Sep 2003 21:52:13 -0400 (EDT)
- Subject: Re: serverside programs
On Thu, 18 Sep 2003, Erik Poupaert wrote:
> Another strategy could be to start and exit the program for every
> request (like cgi or xinetd programs). I was wondering, if the program
> has leaked memory during its execution, will the OS always and fully
> reclaim the memory not freed by the program after the program exits? Or
> in other words, is "exiting" always a full memory cleanup?
Yes. When the program exits, the heap is gone, and its memory pages
become available for other processes.
Though it may be useful for a certain class of problems, this isn't the
typical execution model for Java though. Java should excel at
long-running programs.
For our client we routinely run Java processes for six months or longer
continuously. Heap growth has almost never been a serious problem. We're
much more afraid of deadlock. For example we have an application that
deadlocks on average once a month in a third-party closed-source package
we use, so we have no option but to accept the failures or serialize
every access to the library code.
Jeff