Re: Re: Kernel doesn't free Cached Memory
On Fri, Jul 22, 2005 at 09:02:05AM -0300, Vinicius wrote: Content-Description: Mail message body > On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: > [...] > >>I have a server with 2 Pentium 4 HT processors and 32 GB of >>RAM, > this > >> server runs lots of applications that consume lots of memory to. >>When I > >>stop > >> this applications, the kernel doesn't free memory (the memory >>still in > >>use) > >> and the server cache lots of memory (~27GB). When I start this > >>applications, > >> the kernel sends "Out of Memory" messages and kill some random > >> applications. > >> > >>Anyone know how can I reduce the kernel cached memory on RHEL >>3 > (kernel > >> 2.4.21-32.ELsmp - Trial version)? There is a way to reduce the >>kernel > >>cached > >> memory utilization? > > >Probably RedHat's support can answer this for RHEL 3. > > > > Bernd > > Bernd, > >The server runs RHEL Trial Version, without support... for tests purpose. >... The answers you already got are: - for that much memory, 64bit processors are really recommended - 2.6 kernels are a better choice for this scenario - linux-kernel doesn't support vendor kernels, does the same problem occur with kernel 2.6.12 ? Another thing that surprises me is that why you are testing an old version of RHEL. If you want to build a new system, you should better test RHEL 4. > Vinicius. > Protolink Consultoria. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: Kernel doesn't free Cached Memory
Bill Davidsen wrote: { Al Boldi wrote: > Dick Johnson wrote: { > >>On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: >>[...] >> >>> I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, >>>this server runs lots of applications that consume lots of memory to. >>>When I stop this applications, the kernel doesn't free memory (the >>>memory still in use) and the server cache lots of memory (~27GB). >>>When I start this applications, the kernel sends "Out of Memory" >>>messages and kill some random applications. > > > ...you might even need to turn memory over-commit off: > echo "0" > /proc/sys/vm/overcommit_memory > } > > That's in 2.4. In 2.6 it's: > echo "2" > /proc/sys/vm/overcommit_memory RHEL3 *is* a 2.4 kernel. > > But the kernel doesn't honor no-overcommit in either version, i.e. it still > overcommits/pages-out loaded/running procs, thus invoking OOM! > > Is there a way to make the kernel strictly honor the no-overcommit request? > Don't have swap? } Turn off swap and things get worse! Paolo Ornati wrote:{ Bill Davidsen <[EMAIL PROTECTED]> wrote: > And IMHO Linux is *way* too willing to evicy clean pages of my > programs to use as disk buffer, so that when system memory is full I > pay the overhead of TWO disk i/o's, one to finally write the data to > the disk and one to read my program back in. If free software is > about choice, I wish there was more in the area of how memory is > used. isn't this tuned enough by "/proc/sys/vm/swappiness" ? } Swappiness tunes but does not inhibit overcommit! So the question remains: Why Is there no way to make the kernel _strictly_ honor the no-overcommit request? -- Al - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kernel doesn't free Cached Memory
Al Boldi wrote: Dick Johnson wrote: { On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: [...] I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this server runs lots of applications that consume lots of memory to. When I stop this applications, the kernel doesn't free memory (the memory still in use) and the server cache lots of memory (~27GB). When I start this applications, the kernel sends "Out of Memory" messages and kill some random applications. ...you might even need to turn memory over-commit off: echo "0" > /proc/sys/vm/overcommit_memory } That's in 2.4. In 2.6 it's: echo "2" > /proc/sys/vm/overcommit_memory RHEL3 *is* a 2.4 kernel. But the kernel doesn't honor no-overcommit in either version, i.e. it still overcommits/pages-out loaded/running procs, thus invoking OOM! Is there a way to make the kernel strictly honor the no-overcommit request? Don't have swap? -- -bill davidsen ([EMAIL PROTECTED]) "The secret to procrastination is to put things off until the last possible moment - but no longer" -me - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: Kernel doesn't free Cached Memory
Dick Johnson wrote: { > On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: > [...] >>I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, >> this server runs lots of applications that consume lots of memory to. >> When I stop this applications, the kernel doesn't free memory (the >> memory still in use) and the server cache lots of memory (~27GB). >> When I start this applications, the kernel sends "Out of Memory" >> messages and kill some random applications. ...you might even need to turn memory over-commit off: echo "0" > /proc/sys/vm/overcommit_memory } That's in 2.4. In 2.6 it's: echo "2" > /proc/sys/vm/overcommit_memory But the kernel doesn't honor no-overcommit in either version, i.e. it still overcommits/pages-out loaded/running procs, thus invoking OOM! Is there a way to make the kernel strictly honor the no-overcommit request? Thanks! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kernel doesn't free Cached Memory
On Gwe, 2005-07-22 at 13:00 -0300, Vinicius wrote: >I also read on the Linux-Kernel that the problem may be related to an > exhaustion of your kernels address space, I read that the hugemem-kernel > might be the solution to this case since it has 4GB for the kernel memory > plus 4GB for user process. If its x86-32 then only the hugemem kernel will even see the memory. There are big problems with 32Gb+ on a 32bit processor because there is so little memory usable at a time that even the page tables become problematic. Thankfully all sane machines with that much ram are 64bit. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kernel doesn't free Cached Memory
Em (15:49:49), Alan Cox escreveu: >On Gwe, 2005-07-22 at 08:27 -0300, Vinicius wrote: >> Hi all! >> >> I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this >> server runs lots of applications that consume lots of memory to. When I >stop >> this applications, the kernel doesn't free memory (the memory still in >use) > >See any FAQ on the Linux memory management - memory is reclaimed when >needed not when nobody is using it. That makes things more efficient. > >> and the server cache lots of memory (~27GB). When I start this >applications, >> the kernel sends "Out of Memory" messages and kill some random >> applications. > >Some RHEL3 kernels had a problem with very large memory sizes and 2.4. >That should not be the case in the current RHEL3 kernels. 2.6 handles >very large systems a lot lot better, and of course the fact real >computers now have 64bit processors has also rather improved life. > >Alan > >-- Thanks Alan, I also read on the Linux-Kernel that the problem may be related to an exhaustion of your kernels address space, I read that the hugemem-kernel might be the solution to this case since it has 4GB for the kernel memory plus 4GB for user process. How can I define if my kernel memory is beeing exhausted? Does this exhaustion of kernel memory can cause Out Of memory errors ?
Re: Kernel doesn't free Cached Memory
On Gwe, 2005-07-22 at 08:27 -0300, Vinicius wrote: > Hi all! > >I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this > server runs lots of applications that consume lots of memory to. When I stop > this applications, the kernel doesn't free memory (the memory still in use) See any FAQ on the Linux memory management - memory is reclaimed when needed not when nobody is using it. That makes things more efficient. > and the server cache lots of memory (~27GB). When I start this applications, > the kernel sends "Out of Memory" messages and kill some random > applications. Some RHEL3 kernels had a problem with very large memory sizes and 2.4. That should not be the case in the current RHEL3 kernels. 2.6 handles very large systems a lot lot better, and of course the fact real computers now have 64bit processors has also rather improved life. Alan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kernel doesn't free Cached Memory
On Fri, 22 Jul 2005, Bernd Petrovitsch wrote: > On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: > [...] >>I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this >> server runs lots of applications that consume lots of memory to. When I stop >> this applications, the kernel doesn't free memory (the memory still in use) >> and the server cache lots of memory (~27GB). When I start this applications, >> the kernel sends "Out of Memory" messages and kill some random >> applications. >> >>Anyone know how can I reduce the kernel cached memory on RHEL 3 (kernel >> 2.4.21-32.ELsmp - Trial version)? There is a way to reduce the kernel cached >> memory utilization? > > Probably RedHat's support can answer this for RHEL 3. > > Bernd > -- > Firmix Software GmbH http://www.firmix.at/ > mobil: +43 664 4416156 fax: +43 1 7890849-55 > Embedded Linux Development and Services > How do you know the memory is "still in use?" I think that if you run a program that uses so much memory that some swap is used, but not allowing all free memory to be exhausted, you can run the same program over and over again forever. Therefore, the memory must have been freed and available for the next time you run the program. The problem is that you are exhausting all free memory causing the kernel to kill processes just to stay alive. Then you look at some memory "tool" and think that it shows something about what is, or has been freed. You need to set process limits on the amount of resources each process can use and, depending upon the implementation details of your "server", you might even need to turn memory over-commit off: echo "0" > /proc/sys/vm/overcommit_memory The fact is that unused memory is stored in caches and buffers. That's how it doesn't get wasted. In fact, with a busy system an attempt is made to use all available real RAM and minimize swap. Some server programs are written much like your defective test program. You can't attempt to allocate all virtual memory using malloc(), expecting it to return NULL when there is no more. Malloc() will return NULL when it has gotten trashed by somebody overwriting buffer boundaries or when address-space is exhausted. It has no clue how much RAM is available and, in fact if it did, it would represent an information leak. Programs should allocate what they need, not what they can get. Cheers, Dick Johnson Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips). Warning : 98.36% of all statistics are fiction. . The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [EMAIL PROTECTED] - and destroy all copies of this information, including any attachments, without reading or disclosing them. Thank you. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Re: Kernel doesn't free Cached Memory
On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: [...] >>I have a server with 2 Pentium 4 HT processors and 32 GB of >>RAM, this >> server runs lots of applications that consume lots of memory to. >>When I >>stop >> this applications, the kernel doesn't free memory (the memory >>still in >>use) >> and the server cache lots of memory (~27GB). When I start this >>applications, >> the kernel sends "Out of Memory" messages and kill some random >> applications. >> >>Anyone know how can I reduce the kernel cached memory on RHEL >>3 (kernel >> 2.4.21-32.ELsmp - Trial version)? There is a way to reduce the >>kernel >>cached >> memory utilization? >Probably RedHat's support can answer this for RHEL 3. > > Bernd >-- > Firmix Software GmbH http://www.firmix.at/ >mobil: +43 664 4416156 fax: +43 1 7890849-55 > Embedded Linux Development and Services Bernd, The server runs RHEL Trial Version, without support... for tests purpose. When I compile and run the following tester program: #include #include #include int main (void) { int n = 0; char *p; while (1) { if ((p = malloc(1<<20)) == NULL) { printf("malloc failure after %d MiB\n", n); return 0; } memset (p, 0, (1<<20)); printf ("got %d MiB\n", ++n); } } The server alocates lots of free memory (including swap) to the tester program and when its finish, lots of cached memory are freed. Have someone an idea why it's happens? Or how can I force the kernel to frees cached memory? Thanks again (sorry my bad eglish again!) Vinicius. Protolink Consultoria.
Re: Kernel doesn't free Cached Memory
On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote: [...] >I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this > server runs lots of applications that consume lots of memory to. When I stop > this applications, the kernel doesn't free memory (the memory still in use) > and the server cache lots of memory (~27GB). When I start this applications, > the kernel sends "Out of Memory" messages and kill some random > applications. > >Anyone know how can I reduce the kernel cached memory on RHEL 3 (kernel > 2.4.21-32.ELsmp - Trial version)? There is a way to reduce the kernel cached > memory utilization? Probably RedHat's support can answer this for RHEL 3. Bernd -- Firmix Software GmbH http://www.firmix.at/ mobil: +43 664 4416156 fax: +43 1 7890849-55 Embedded Linux Development and Services - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Kernel doesn't free Cached Memory
Hi all! I have a server with 2 Pentium 4 HT processors and 32 GB of RAM, this server runs lots of applications that consume lots of memory to. When I stop this applications, the kernel doesn't free memory (the memory still in use) and the server cache lots of memory (~27GB). When I start this applications, the kernel sends "Out of Memory" messages and kill some random applications. Anyone know how can I reduce the kernel cached memory on RHEL 3 (kernel 2.4.21-32.ELsmp - Trial version)? There is a way to reduce the kernel cached memory utilization? Thanks in advance (sorry my bad english). Vinicius. Protolink Consultoria.