Re: Bad ESQL/C Memory Configuration
Posted in 1998
Jonathan Leffler <jleffler@earthlink.net> offerred:
+Christian Kissner wrote:
+>
+> I have a problem allocating medium-sized memory when using ESQL-C.
+> Actually, it happens after connecting to my Database: All the
+> Memory I can get is just below 8MB !
+>
+> [...]
+>
+> For Information:
+> I'm running program and server on the same Machine, Sun UltraSparc
+> with Solaris 2.5.1 and 512 MB RAM (and plenty of real and virtual
+> memory free while running) with Informix Online Server 7.24 UC2.
+> I' us onipcshm to connect, but couldn't find any Shared memory
+> parameter to affect this.
+
+Check INFORMIXSHMBASE -- I think that's the environment variable that
+resolves this sort of problem. Certainly, the problem is related to
+the shared memory connection and the address it uses. If all else
+fails, change connectivity to oltlitcp or olipcstr.
Jonathan is spot on here. When you use a shared memory connection to the server, the
message segment of shared memory used for the communication needs to be attached to
the memory of your process at some location. Traditionally, this is set on the high
end, and your swap and data space is on the low end, growing up toward the high end.
When it hits the point at which the shared memory segment is attached to the process
memory, it has to stop, i.e. no more memory can be allocated by the program.
The solution is to use INFORMIXSHMBASE to specify the address at which the shared
memory segment is attached to the process memory. The higher the value, the more
"room" there will be in the process address space to accomodate dynamically allocated
memory in your program. You could set this value arbitrarily large (e.g. export
INFORMIXSHMBASE=99999999999), Or, if you know the approximate memory needs of yourapplication, set it to a value just beyond that limit. Offhand, I don't know what
the default value is.
Jonathan is also right on the money in that using a protocol other than shared memory
will avoid the problem altogether.
Dave
** Dave Kosenko <davek@summitdata.com>
** Director of Training Services (732) 469-4070
** Summit Data Group (an Informix Authorized Education Center)
** Find my advice useful? Let me teach you everything I know about
** Informix. Sign up for OFFICIAL Informix training at SDG.
** For details, see http://www.summitdata.com/training