Re: Help - AIX4.3.3 - malloc return "nil" although there is enough memory(physical+Virtual) available?

From: in (trendin_at_hotmail.com)
Date: 01/06/04


Date: 5 Jan 2004 17:08:43 -0800

hi, thank you for your reply, here still 3 question based on your
answer:
1. from nmon/vmstat/vsmon(in my first message)..., my process consumes
less than 150m memory, why need "bmaxdata" to get large program
support?

And why you all address "The memory limitation is on YOUR PROGRAM and
not on the entire OPERATING SYSTEM." - is there anything improper in
my first message violate the concept?

2. If luckly that is the root of the problem, where should I add that
ld option "bmaxdata" - my ".so" or the test program(executable) or
BOTH?

3. I can not catch your meaning in the last sentense, that "There is
also a work around with the dd command if the make process is
involved, but for now just recompile it with the correct flags.", may
you give me more light or URL related?

(btw, my program[.so] was called by the test program, a executable;
and my program will spawn a executable/independent process, is more
work necessary?)

Great thanks again for help from all friends, bow!

andy314159pi@yahoo.com (Andy Y) wrote in message news:<c3214d0d.0401050146.523600b4@posting.google.com>...
> trendin@hotmail.com (in) wrote in message news:<3754f459.0401041642.2ce0b016@posting.google.com>...
> > Nicholas Dronen <ndronen@io.frii.com> wrote in message news:<3ff83eaf$0$195
> > > i> Here comes my question: Why, malloc return "nil" although there are
> > > i> enough memory(physical+Virtual) available?> >
> > > The scope of memory limits as they apply to malloc is the process,
> > > not the entire operating system.
> > > See:
> > > http://www.faqs.org/faqs/aix-faq/part4/section-24.html
> > Dear Nicholas,
> > Sorry for my asininity, I am not so clear about your reply?
> > In fact, I have also found that URL, however, I am not sure this topic
> > related with my problem - do you say that, my process disclaims more
> > memory that 256M, therefore must use link option "bmaxdata"?
> > And why do you address "The scope of memory limits as they apply to
> > malloc is the process, not the entire operating system." for me - Did
> > my question misunderstand it?
> > Thank you for your quick reply, I am so exhaust on this problem, and
> > so anxious for a clew
>
>
>
> Let me help clarify what Nicholas said: The memory limitation is on
> YOUR PROGRAM and not on the entire OPERATING SYSTEM. AIX requires
> that you compile large programs with the flags that he pointed out.
> You have to specify the maximum size of your program image after the
> -bmaxdata flag in hexedecimal.
> If (without using the compiling flag) you try to run a program that
> uses more than the aforementioned amount of memory, then the operating
> system will laugh at you and kill your program. By the way, the most
> memory that you can give a program in a 32 bit environment is 2 GB.
> Somebody else can tell us what the limit is for 64 bit environments.
> So get off your *** and recompile that sucker! There is also a work
> around with the dd command if the make process is involved, but for
> now just recompile it with the correct flags.