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 20:07:40 -0400 (EDT)
- Subject: Re: serverside programs
On Wed, 17 Sep 2003, Erik Poupaert wrote:
> So, the fact that garbage collection is active, does not mean that the
> code could not be full of memory leaks.
Definitely.
> A java serverside program can
> bring down your machine (or
> else its own process), no sweat; and given the starting footprint (tens of megabytes)
> and the speed at which numerous heap-based objects tend to get created, way much
> easier than native programs.
I don't see how the last claim follows. I've witnessed much buggy C/C++
code eat heap at alarming rates too; I disbelieve Java has any inherent
characteristic that puts it at a disadvantage there. Buggy code is buggy
code. And at least you're avoiding the worst problems: buffer overflow
exploits, freeing blocks prematurely, etc.
> I've replaced the java emailserver with (native) qmail; and memory consumption hasn't
> budged since. In my opinion, gcj needs options to reduce starting footprint
> drastically, and then an option that introduces more predictable memory
> de-allocation. Otherwise how can we recommend writing serverside applications like
> qmail in Java to other people?
You can always the GC_MAXIMUM_HEAP_SIZE environment variable with libgcj
to prevent a rogue program from consuming all system resources.
Jeff