This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: maximum memory for gcj-compiled executable?
- From: fernando at lozano dot eti dot br
- To: "Erik Poupaert" <erik dot poupaert at chello dot be>,"GCJ Java" <java at gcc dot gnu dot org>
- Date: Tue, 25 Mar 2003 16:20:45 GMT
- Subject: RE: maximum memory for gcj-compiled executable?
- Reply-to: fernando at lozano dot eti dot br
Hi Eric,
> I've just found that jdbc hangs on to old resultsets,
> unless I close resultset, statement, connection, ... When
> I close the whole lot explicitly, the growth in memory
> consumption is much slower. I guess these data structures
> are much more difficult to collect, if I don't null them
> explicitly.
It's a known Java best-practice (well, not so well known
unfortunately) to null
unused references (and their references, and so on) and to
explicitly close or
clean objects that represent system resources like
connections and statements.
Many C++ and Object Pascal programmers become got used to
automatic destructors
when objects fall out of scope and won't worry about
releasing resources. Java
needs you to release them explicitly. The best garbage
collector and memory
management subsystems won't be able do to this for you, they
aren't supposed to do.
[]s, Fernando Lozano