I'm running a C++ program in Ubuntu 10.04 (32-bit system architecture). If I calculate the amount of memory that my program uses, it comes up to 800MB. I have a 4GB RAM in place. But still before the program even finishes it throws an out of memory exception. Why is that happening ? Is it because of the structure of the memory or implementation problems or what could possibly trigger this issue ? I've had seen this problem quite a number of times before but never understood the reason behind it. Have any of you handled this case before ?
Update:
The program I'm trying to run is here with explanation. To increase the amount of memory I use I just icrease the value of max_i in the main function.
ulimit. – mbaitoff Feb 28 '11 at 5:00