malloc refuses to allocate more than 3k

tk (tk@alliancestudio.com)
Thu, 17 Jul 1997 20:28:06 -0800


I have a CGI application which causes a routine call to malloc to fail.
The system seems to only give up upto 3000 units of memory, or there abouts
(3000 succeeds while 4000 and upwards fail).

I am using 2.0.30 with /lib/libc.so.5.3.12.

The call to malloc is totally routine and works in other apps just fine,
being able to call much large amounts of memory without any problems.

Below is the part of the code which is causing the problem. The source is
split into several files which have never cause problems like this before.
When the value for malloc is 3000, fatalError("testing..4.") executes. When
the value is 4000 or more, it fails.

/* tmpBuffer = (char *) malloc(fileStat.st_size + 1); */ /* This call
fails when the filesize is more than some arbitray limit. Apparently
between 3-4k */
tmpBuffer = (char *) malloc(3000); /*this call works */
if (tmpBuffer == NULL) fatalError ("Couldn't get memory");
fatalError("testing..4.");

I know I am not providing a lot of info, but outside sending all the files,
I don't know where to look.

I would REALLY appreciate any bit of advice on this. I am at the end of my
rope and any advice at all would be greatly appreciated.

Thanks,

Troy

P.S. This question should possibly be somewhere else, but since
C-programming seems to be dead and I can't think of any other suitable
list, I am resorting to posting here.

Troy Korjuslommi ALLIANCE STUDIO
Technical Director http://www.alliancestudio.com/
e. tk@alliancestudio.com ph. (310) 458-0884
http://www.alliancestudio.com/tk/ fx. (310) 395-5741
--------- SAMPLE SITES ---------
http://www.bodyofwords.com/ http://www.erascenter.com/
http://www.starlight.org/ http://www.gyw.com/hakimbey/
http://www.alliancestudio.com/brady/ http://www.gyw.com/traveldoc/
http://www.gyw.com/asa/ http://www.alliancestudio.com/