This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: maximum memory for gcj-compiled executable?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]