> Actually, I tried that. Unfortunately, the ibserver.exe process does not
> recover the memory.
> --Chris.
> "Jason Wharton" <jwhar...@ibobjects.com> wrote in message
> news:3b37a3d0$1_1@dnews...
> > Then it is for sure a bug in the interserver/interclient driver. Stop
and
> > start the interserver process and I bet within seconds the ibserver
> process
> > recovers handsomely.
> > --
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> > "Chris Smith" <csm...@tripwire.com> wrote in message
> > news:3b37a005$1_1@dnews...
> > > I don't think it is tied at all to Java garbage collection. When the
> test
> > > program exits, all of the memory is still consumed by the IB
processes.
> > > --Chris.
> > > "Jason Wharton" <jwhar...@ibobjects.com> wrote in message
> > > news:3b379e24$1_2@dnews...
> > > > I would suspect this as a bug in the interserver/interclient
> > > implementation
> > > > then.
> > > > What you are doing is chewing up statement handles and for some
reason
> > > they
> > > > are not being deallocated.
> > > > Is there any way you can know if garbage collection is taking place.
> > > > I sure would hate to think that database resources are being tied to
> > JAVA
> > > > garbage collection.
> > > > There should be a way that you can explicitly demand database
> resources
> > to
> > > > be released before an object is put on the garbage collection queue.
> > > > Sure glad I use Delphi (and not IBX).
> > > > FWIW,
> > > > Jason Wharton
> > > > CPS - Mesa AZ
> > > > http://www.ibobjects.com
> > > > "Chris Smith" <csm...@tripwire.com> wrote in message
> > > > news:3b379a7d$1_2@dnews...
> > > > > Actually both processes are showing the leak (ibserver.exe and
> > > > > interserver.exe). As far as not unpreparing goes, the only method
> > > > available
> > > > > is close() to deallocate. Here is the Javadoc:
> > > > > /**
> > > > > * Releases this <code>Statement</code> object's database
> > > > > * and JDBC resources immediately instead of waiting for
> > > > > * this to happen when it is automatically closed.
> > > > > * It is generally good practice to release resources as soon as
> > > > > * you are finished with them to avoid tying up database
> > > > > * resources.
> > > > > * <P><B>Note:</B> A <code>Statement</code> object is
> automatically
> > > > closed
> > > > > when it is
> > > > > * garbage collected. When a <code>Statement</code> object is
> closed,
> > > its
> > > > > current
> > > > > * <code>ResultSet</code> object, if one exists, is also closed.
> > > > > *
> > > > > * @exception SQLException if a database access error occurs
> > > > > */
> > > > > Also, note that it does not leak memory when I replace "Statement"
> > with
> > > a
> > > > > "PreparedStatement". Therefore, I am guessing that my code is
> correct.
> > > > > --Chris.
> > > > > "Jason Wharton" <jwhar...@ibobjects.com> wrote in message
> > > > > news:3b37991b$1_2@dnews...
> > > > > > Which process is showing the memory growth?
> > > > > > IBServer or the server for Interserver that hosts Interclient?
> > > > > > You are creating and allocating a statement and merely closing
it
> > > (which
> > > > > > relates to a cursor only). How can it actually unprepare and
> > > deallocate
> > > > > the
> > > > > > statement? Apparently JDBC expects you to explicitly handle this
> > > detail.
> > > > > > I'm a Delphi guy so I could be wrong... but I am very confident
> your
> > > > code
> > > > > is
> > > > > > wrong.
> > > > > > Regards,
> > > > > > Jason Wharton
> > > > > > CPS - Mesa AZ
> > > > > > http://www.ibobjects.com
> > > > > > "Chris Smith" <csm...@tripwire.com> wrote in message
> > > > > > news:3b37834f$1_2@dnews...
> > > > > > > Over the weekend, I had the pleasure to find the location of
an
> > > > enormous
> > > > > > > memory leak in Interbase. I searched the newsgroups, and other
> > > threads
> > > > > > > related to IB, and found several people complaining about such
> > > leaks.
> > > > > > > However, all of the responses from Borland folks have stated
> that
> > > the
> > > > > > issue
> > > > > > > was due to unclosed connections, etc.
> > > > > > > Well, I have a reproducible test case that is only a couple
> lines.
> > > > > > > My configuration is as follows:
> > > > > > > Interbase 6.01 (Open Source)
> > > > > > > Interbase Client 1.60 (I have also reproduced with 2.0) (Open
> > > Source)
> > > > > > > JDBC Drivers 1.60
> > > > > > > Windows 2000
> > > > > > > The problem appears to show itself when using JDBC Statement
> > > > operations
> > > > > > that
> > > > > > > perform updates (delete, update, etc.). Here is the sample
code
> > that
> > > > > will
> > > > > > > allow you to deplete your computer of all its memory.
> > > > > > > try
> > > > > > > {
> > > > > > > Connection con = /* Create JDBC connection here using
> > > > > > > "interbase.interclient.Driver" */
> > > > > > > for( int i = 0; i < 1000; i++ )
> > > > > > > {
> > > > > > > int newVal = (int)(Math.random() * 100000);
> > > > > > > Statement st = con.createStatement();
> > > > > > > st.executeUpdate( "update foo set foocol = " + newVal
+
> "
> > > > where
> > > > > > > foocol > 0" );
> > > > > > > st.close();
> > > > > > > con.commit();
> > > > > > > }
> > > > > > > con.close();
> > > > > > > }
> > > > > > > catch( Exception e )
> > > > > > > {
> > > > > > > e.printStackTrace();
> > > > > > > }
> > > > > > > The DDL is the following: create table foo( foocol
integer );
> > > > > > > I insert a row before testing, but it doesn't matter, the leak
> > > occurs
> > > > in
> > > > > > > either case.
> > > > > > > When you run this program, watch the memory consumption of
> > > > ibserver.exe
> > > > > > and
> > > > > > > interserver.exe (the connection). Both of these processes will
> > leak
> > > > > memory
> > > > > > > at a huge rate. When the program exits, none of the memory is
> > > > reclaimed.
> > > > > > > The most interesting part is that if you change the Statement
> > above
> > > to
> > > > a
> > > > > > > PreparedStatement, the processes hardly leak at all. If they
do
> > leak
> > > > it
> > > > > is
> > > > > > > at a very low rate.
> > > > > > > If there is anything I am missing, or something I am doing
> wrong,
> > > > please
> > > > > > let
> > > > > > > me know.
> > > > > > > --Chris.