From: Paul H. Hargrove (PHHargrove_at_lbl_dot_gov)
Date: Mon Feb 14 2005 - 10:35:17 PST
Tarun, When started with cr_run, your program will run in a pthreads environment. For 99% of normal operations that fact is totaly transparent. The one thing that is different and visible to the program is that the stack is smaller (apparently it is 4MB minus some overhead), which is leading to your problems with stack allocation. I don't know of any work arounds available to give you back the full stack size. Dynamic allocation via malloc/new should not be affected. If this is a critical problem for you, please go to http://mantis.lbl.gov/bugzilla and enter a bug report there. Then we'll begin looking for ways to eliminate this problem in the future. -Paul Tarun Agarwal wrote: >Hi Paul, > >I was recently experimenting with blcr-0.3.1 on a 2.4 kernel on AMD >Athlon. While I can allocate upto 8MB of memory normally with my user >program, when started with cr_run I cannot even allocate 3MBs(leads to a >seg fault). I am wondering whether all that is overhead or a bug?? > >Thanks >Tarun > >---------------------------------------- >/* A simple program to test amount of memory > * that can be allocated. > */ >#include <iostream> >#include <stdlib.h> >using namespace std; > >int main(int argc,char **argv) >{ > if(argc!=2) > { > cout<<"Usage : "<<argv[0]<<" <Number of MBs to be >allocated>"<<endl; > exit(0); > } > int numBytes=atoi(argv[1])*1000000; > int a[numBytes/sizeof(int)]; > cout<<"Allocated : " <<sizeof(a)<<" bytes"<<endl; > return 0; >} > > >