malloc for 1 Mb error.

Hi All!

Does some one know I am under UNIX system can not allocate more then 1 Mb memory? It broke program down.

Any information would be greatly appreciated.
Thanks.

It seems unbelievable.

In one of my program, I did allocate a memory more than 1M, and it works well.

Could you post your code here?

When you malloc space you are attempting to increase the size of the data segment. Most unix system have some limit on the max size of a data segment often controlled by a kernel parameter called maxdsize or something like that. Additional you need to have enough resources (mostly swap area) to handle the additional virtual memory.

On every unix system in existence, if you malloc a MB of memory in a loop you will eventually fail. And if your program starts out with a very large data segment it is certainly possible that won't even be able to malloc one MB.