[comp.unix.questions] Memory Allocation

cheryl@bluemtn.uucp (Cheryl Lindsey ) (02/07/90)

 I am allocating pointers right and left and after a
certain point the program will not allow me to allocate any more.

I have tried to compile using the -LARGE
option to get a large model memory, 
only I get this response


I am using a make file that looks like the following:

#
#

OBJ = sumphero.o miracle.o rdfiles.o srt.o mathfunc.o

CFLAGS = -LARGE

sumph:	$(OBJ)
	cc $(CFLAGS) $(OBJ) -o sumphero

$(OBJ):	sumphero.h structs.h macdef.h


The environment I am using is SCO UNIX System V/386 release 3.2.0 
on an IBM PS/2 Model 70 386.  (Customer supplied not company choice.)


If anyone has an idea on how to be able to allocate more space, I would
love to hear it.  

Also, some of the pointers I am allocating are to large structures, 
to to the real stuff.

After about 400K bytes allocated the program quits allocating space.
Is there some way around this.

Thanks,
Cheryl Lindsey


..!uunet!emory!bluemtn!cheryl

jik@athena.mit.edu (Jonathan I. Kamens) (02/07/90)

In article <1990Feb6.185840.8866@bluemtn.uucp>, cheryl@bluemtn.uucp
(Cheryl Lindsey) writes:
>  I am allocating pointers right and left and after a
> certain point the program will not allow me to allocate any more.
> ...
> The environment I am using is SCO UNIX System V/386 release 3.2.0 
> on an IBM PS/2 Model 70 386.  (Customer supplied not company choice.)
> ...
> After about 400K bytes allocated the program quits allocating space.
> Is there some way around this.

  I note with bemusement that you've went into great detail about the
machine you are using, but didn't bother to mention the somewhat
important details of how much memory your system has and how the
per-process limits are configured by default.  That would certainly help
to diagnose the problem.

  A few other questions I have -- (1) Are you ever *freeing* any of the
pointers that you are allocating?  (2) When you say that you are
allocating "pointers", do you mean that you are allocating space for
things like structures and then assigning the address of that allocated
space to a pointer?  (3) What are you using for allocation, malloc?  (4)
What error do you get when you can no longer allocate -- out of memory,
or something else?

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710