2008/11/20 Michael Matz <[EMAIL PROTECTED]>: > Hi, > > On Wed, 19 Nov 2008, H.J. Lu wrote: > >> On Wed, Nov 19, 2008 at 7:18 PM, Nicholas Nethercote >> <[EMAIL PROTECTED]> wrote: >> > On Tue, 18 Nov 2008, H.J. Lu wrote: >> > >> >>> I used malloc to create my arrays instead of creating the in the stack. >> >>> My program is working now but it is very slow. >> >>> >> >>> I use two-dimensional arrays. The way I access element (i,j) is: >> >>> array_name[i*row_length+j] >> >>> >> >>> The server that I use has 16GB ram. The ulimit -a command gives the >> >>> following output: >> >>> time(seconds) unlimited >> >>> file(blocks) unlimited >> >>> data(kbytes) unlimited >> >>> stack(kbytes) 8192 >> >> >> >> ^^^^^^^^^^^^^^^^^^^^^^^^ >> >> >> >> That limits stack to 8MB. Please change it to 1GB. >> > >> > Why? >> > >> >> int buffer1[250][1000000]; >> >> takes close to 1GB on stack. > > Read the lines you quoted carefully again. > > > Ciao, > Michael. >
Can you please talk in a more understandable way? I also think that 4 * 250 * 1000000 is close to 1073741824 which is 1 Gb. And automatic variables are allocated in stack (which is 8Mb here) instead of data segment. Alexey