Re: [CentOS] top and allocation issues

2011-03-04 Thread Brunner, Brian T.
> It appears that option 2 would be the best for me, so I set: sysctl > vm.overcommit_memory=2 > > However, it resets to 0 on reboot, and only root can reset it. > It would be good if it would be set to 2 on reboot. Is there > a good way to do this? I suppose I could put something in > /etc/i

Re: [CentOS] top and allocation issues

2011-03-03 Thread Stephen Harris
On Fri, Mar 04, 2011 at 12:52:51AM +, Michael D. Berger wrote: > It appears that option 2 would be the best for me, so I set: > sysctl vm.overcommit_memory=2 > > However, it resets to 0 on reboot, and only root can reset it. > It would be good if it would be set to 2 on reboot. Is there > a g

Re: [CentOS] top and allocation issues

2011-03-03 Thread Michael D. Berger
On Thu, 03 Mar 2011 15:03:34 -0500, Stephen Harris wrote: > On Thu, Mar 03, 2011 at 07:55:57PM +, Michael D. Berger wrote: [...] > > /proc/sys/vm/overcommit_memory > (or sysctl vm.overcommit_memory) > >>From the kernel Documentation: > > This value contains a flag that enables memory overco

Re: [CentOS] top and allocation issues

2011-03-03 Thread Ross Walker
On Mar 3, 2011, at 2:21 PM, "Michael D. Berger" wrote: > In a context where exceptions are caught, I ran > the fragment: > > cerr << "allocating" << endl; > char*arr[100]; > for (int jj = 0; jj < 10; ++jj) > { > cerr << "jj = " << jj << endl; > arr[jj] = new char[2

Re: [CentOS] top and allocation issues

2011-03-03 Thread Les Mikesell
On 3/3/2011 2:26 PM, Michael D. Berger wrote: > On Thu, 03 Mar 2011 15:03:34 -0500, Stephen Harris wrote: > > >> >> /proc/sys/vm/overcommit_memory >> (or sysctl vm.overcommit_memory) >> >> > From the kernel Documentation: >> >> This value contains a flag that enables memory overcommitment. >> >> Wh

Re: [CentOS] top and allocation issues

2011-03-03 Thread Michael D. Berger
On Thu, 03 Mar 2011 15:03:34 -0500, Stephen Harris wrote: > > /proc/sys/vm/overcommit_memory > (or sysctl vm.overcommit_memory) > >>From the kernel Documentation: > > This value contains a flag that enables memory overcommitment. > > When this flag is 0, the kernel attempts to estimate the am

Re: [CentOS] top and allocation issues

2011-03-03 Thread Brunner, Brian T.
centos-boun...@centos.org wrote: > > Yes, I do expect to do a bit of arithmetic. I will need > several blocks of about 0.5G, and I am checking the limits. > Is it true, then, that I won't really know if I succeeded with > the allocation until I try to write the memory? What will > happen then? Is

Re: [CentOS] top and allocation issues

2011-03-03 Thread Stephen Harris
On Thu, Mar 03, 2011 at 07:55:57PM +, Michael D. Berger wrote: > Yes, I do expect to do a bit of arithmetic. I will need > several blocks of about 0.5G, and I am checking the limits. > Is it true, then, that I won't really know if I succeeded with > the allocation until I try to write the memo

Re: [CentOS] top and allocation issues

2011-03-03 Thread Michael D. Berger
On Thu, 03 Mar 2011 14:38:52 -0500, Brunner, Brian T. wrote: [...] > > Holy RAMbo, batman! How many GB of RAM do you intend to allocate? Once > you allocate 2GB like you did, you MUST be running a bigmem or x64 > kernel to allocate another 2GB. > > You won't see 'new'd memory as "taken" in top(

Re: [CentOS] top and allocation issues

2011-03-03 Thread Michael D. Berger
On Thu, 03 Mar 2011 14:34:13 -0500, m.roth-x6lchVBUigD1P9xLtpHBDw wrote: > Michael D. Berger wrote: >> In a context where exceptions are caught, I ran the fragment: >> >>cerr << "allocating" << endl; >>char*arr[100]; >>for (int jj = 0; jj < 10; ++jj) >>{ > >> Wherein do I err?

Re: [CentOS] top and allocation issues

2011-03-03 Thread Brunner, Brian T.
centos-boun...@centos.org wrote: > In a context where exceptions are caught, I ran > the fragment: > >cerr << "allocating" << endl; >char*arr[100]; >for (int jj = 0; jj < 10; ++jj) >{ > cerr << "jj = " << jj << endl; > arr[jj] = new char[2,000,000,000]; // This line

Re: [CentOS] top and allocation issues

2011-03-03 Thread m . roth
Michael D. Berger wrote: > In a context where exceptions are caught, I ran > the fragment: > >cerr << "allocating" << endl; >char*arr[100]; >for (int jj = 0; jj < 10; ++jj) >{ > Wherein do I err? It would have been caught on 0 if that was jj++, *not* ++jj (increment *after* th

[CentOS] top and allocation issues

2011-03-03 Thread Michael D. Berger
In a context where exceptions are caught, I ran the fragment: cerr << "allocating" << endl; char*arr[100]; for (int jj = 0; jj < 10; ++jj) { cerr << "jj = " << jj << endl; arr[jj] = new char[20]; sleep (30); } sleep (10); for (int jj = 0; jj < 10;