A quick (stupid) question...
I used to do a lot of C on DOS/MS C/Borland compilers.
As I understand the malloc() function used to allocated memory from "DOS" or "BASE" memory, which was 640K(w/o Himem) if you wanted to use anymore, you'd need protected mode, EMM, etc and was quite difficult - so I used to use files instead (because I'm a lazy quitter :-))
Under linux/gcc, what memory am I getting when I use malloc()? I thought it was all the RAM availible, but just saw it run out of mem when allocating mem for 60,000 data structures and the RS/6000 I'm doing it on has 16GB RAM...
I was also under the impression that the BIOS has something to do with the 640k base but RS6k - no BIOS...
would anyone be kind enough to put straight my meed up brain on this matter?
> Under linux/gcc, what memory am I getting when I use malloc()?
Virtual memory, which has nothing (or not much) to do with how much physical memory you have.
> run out of mem when allocating mem for 60,000 data structures
But how big was each structure instance?
Linux (like all protected operating systems) has the ability to restrict the amount of memory any single process can allocate. Use the "ulimit" command to find out what the limits are for you.
Thanks for your prompt reply.
ulimit replies "unlimited"
Don't know at the moment how big one of my data structures is but 60,000 is a silly amount - 800 will be more than enough but I was trying to see where my limits are. Will be doing this project on a Intel which is replacement for the afore mentioned RS but the PC and RS both give me my highly descriptive "not aloc mem" error message :-) at the same place, just made me think back to the days of DOS and its rubbish base memory system.
Thanks for your help.