Re: ESQLC prepare/execute/free causes memory leak on server
Posted in 1998
Jonathan Leffler wrote: > > Nick Rumble wrote: > > Is anyone aware of problems with ESQL/C (7.?) causing a memory leak in > > Online (7.12 -> 7.23) by not freeing memory off following a calling to > > $FREE. A typical scenario might be: > > > > $CHAR col2val[10]; > > > > for (i = 0; i < 1000; i++) > > { > > $PREPARE p1 FROM SELECT * from table where col1 > 'A' and col2 = ?; > > $DECLARE c1 CURSOR WITH HOLD FOR p1; > > $EXECUTE c1 USING $col2val; > > $FETCH c1 INTO .....; > > $CLOSE c1; > > $FREE p1; > > -- Add here -- > EXEC SQL FREE c1; > > > } > > You haven't freed any of the cursors (only the prepared statement), so > memory is being eaten up. This is a big change from pre-5 ESQL/C where > freeing both the statement and the cursor was a core-dumping error. > > Yours, > Jonathan Leffler (jleffler@earthlink.net) #include <many-aliases.h> Yes. You do read the release notes, don't you? It was all explained in there quite clearly. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk --- My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/