serverside programs
Jeff Sturm
jsturm@one-point.com
Thu Sep 18 02:03:00 GMT 2003
On 2003年9月18日, 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
More information about the Java
mailing list