Memory allocation error - esql/c
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I have a problem during memory allocation in esql/c routine on following components: OS: SiniX 5.44 B1007 4/2560 IDS: 7.31.UD2X5 ESQL/C 7.24.UC6 with the command "malloc()" from esql/c we can only allocate approx. 12 MB this error does not occur with a plain c-programm. ( in a test we allocated more than 200 MB ). There are no error entries in the online.log file or /var/log/messages. Does anybody knows that problem ? TIA Ruediger
R?diger Papke wrote: > I have a problem during memory allocation in esql/c routine on following components: > > OS: SiniX 5.44 B1007 4/2560 > IDS: 7.31.UD2X5 > ESQL/C 7.24.UC6 > > with the command "malloc()" from esql/c we can only allocate approx. 12 MB > this error does not occur with a plain c-programm. > ( in a test we allocated more than 200 MB ). > > There are no error entries in the online.log file or /var/log/messages. > > Does anybody knows that problem ? You're using shared memory connections and INFORMIXSHMBASE is not set, or is set too low. Consequently, your memory allocations run into the shared memory segment, and fail - out of memory. Fixes: don't used shared memory database connections; don't use INFORMIXSHMBASE; use INFORMIXSHMBASE of zero; use a bigger value for INFORMIXSHMBASE. At least one of these should work. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<eJTyb.24585$n56.11962@newsread1.news.pas.earthlink.net>... > R?diger Papke wrote: > > > I have a problem during memory allocation in esql/c routine on following components: > > > > OS: SiniX 5.44 B1007 4/2560 > > IDS: 7.31.UD2X5 > > ESQL/C 7.24.UC6 > > > > with the command "malloc()" from esql/c we can only allocate approx. 12 MB > > this error does not occur with a plain c-programm. > > ( in a test we allocated more than 200 MB ). > > > > There are no error entries in the online.log file or /var/log/messages. > > > > Does anybody knows that problem ? > > You're using shared memory connections and INFORMIXSHMBASE is not set, > or is set too low. Consequently, your memory allocations run into the > shared memory segment, and fail - out of memory. > > Fixes: don't used shared memory database connections; don't use > INFORMIXSHMBASE; use INFORMIXSHMBASE of zero; use a bigger value for > INFORMIXSHMBASE. At least one of these should work. Before publishing this problem I had the same idea. Primary this program used SHM-connection(default SHMBASE=0x2000000). But I tried TCP-connection and the same problem still remains. The server is configured for TCP- and SHM-connection (default SHMBASE=0x2000000). I think if only the (via-tcp-connecting) client has this problem, the SHMBASE-address of the server does not matter. Any other ideas, recommendations ? TIA Ruediger
R?diger Papke wrote: > Jonathan Leffler <jleffler@earthlink.net> wrote: >>R?diger Papke wrote: >>>I have a problem during memory allocation in esql/c routine on following components: >>> >>>OS: SiniX 5.44 B1007 4/2560 >>>IDS: 7.31.UD2X5 >>>ESQL/C 7.24.UC6 >>> >>>with the command "malloc()" from esql/c we can only allocate approx. 12 MB >>>this error does not occur with a plain c-programm. >>>( in a test we allocated more than 200 MB ). >>> >>>There are no error entries in the online.log file or /var/log/messages. >>> >>>Does anybody knows that problem ? >> >>You're using shared memory connections and INFORMIXSHMBASE is not set, >>or is set too low. Consequently, your memory allocations run into the >>shared memory segment, and fail - out of memory. >> >>Fixes: don't used shared memory database connections; don't use >>INFORMIXSHMBASE; use INFORMIXSHMBASE of zero; use a bigger value for >>INFORMIXSHMBASE. At least one of these should work. > > Before publishing this problem I had the same idea. Worth mentioning then - it might have saved a 24-hour cycle... > Primary this program used SHM-connection(default SHMBASE=0x2000000). There are only 6 zeroes there, so that's 24 zero bits, or a 32 MB offset to the start of shard memory. Try adding a seventh zero? > But I tried TCP-connection and the same problem still remains. Odd; the problem is in ESQL/C? Using TCP should remove the problem - unless there's a default connection still being made. What's your INFORMIXSERVER set to? Is it still a shared memory connection and you chose dbase@tcp_server to test the TCP connection? You may find that ESQL/C is still connecting to the shared memory server, as well as the TCP/IP server. > The server is configured for TCP- and SHM-connection (default SHMBASE=0x2000000). Still only 6 zeroes, not 7. > I think if only the (via-tcp-connecting) client has this problem, > the SHMBASE-address of the server does not matter. I agree that this is odd. Do you have 'truss' or its equivalent available to you? Have you used it? Does it show any shared memory being allocated (probably shmat()). > Any other ideas, recommendations ? No other ideas from me - at least, not unprodded. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/