ESQL/C memory leak while working with LVARCHAR data (on Win32)
Posted in 2004
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design
While working with lvarchar data on win32 platform I'd trap on serious memory leak when such data is deallocated. Here is simple ESQL/C program: #include <stdio.h> int main() { EXEC SQL BEGIN DECLARE SECTION; lvarchar *_value; EXEC SQL END DECLARE SECTION; char testdata[100]; int i; for (i = 0; i < 10000000; i++) { _value = 0; ifx_var_flag(&_value, 0); ifx_var_alloc(&_value, 101); ifx_var_setlen(&_value, 100); ifx_var_setdata(&_value, testdata, 100); ifx_var_init(&_value); ifx_var_dealloc(&_value); } getchar(); } When this program is running memory used by it's process grows extremely fast. Does anybody have any expirience with such problem ? P.S. Informix CSDK 2.80TC2 was used. -- With best regards BSV
Just for information... I just compile and launch and : it works the same for me .... It grows ..... I can't find any doc on the functions.... So i do not even know what it does Windows with : CSDK 2.81TC2 "Sergey V. Buturlakin" <fisher@softline.kiev.ua> a 'crit dans le message de news:fa109156.0402261200.5a6e4796@posting.google.com... > While working with lvarchar data on win32 platform I'd trap on serious > memory leak when such data is deallocated. Here is simple ESQL/C > program: > > #include <stdio.h> > > int main() > { > EXEC SQL BEGIN DECLARE SECTION; > lvarchar *_value; > EXEC SQL END DECLARE SECTION; > char testdata[100]; > int i; > > for (i = 0; i < 10000000; i++) > { > _value = 0; > ifx_var_flag(&_value, 0); > ifx_var_alloc(&_value, 101); > ifx_var_setlen(&_value, 100); > ifx_var_setdata(&_value, testdata, 100); > ifx_var_init(&_value); > ifx_var_dealloc(&_value); > } > > getchar(); > } > > When this program is running memory used by it's process grows > extremely fast. > Does anybody have any expirience with such problem ? > > P.S. Informix CSDK 2.80TC2 was used. > > -- > With best regards > BSV