Quoted 1 line · Vinicius
On Fri, 2005-07-22 at 08:27 -0300, Vinicius wrote:
[...]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I have a server with 2 Pentium 4 HT processors
and 32 GB of >>RAM,
Quoted 4 lines
this
Quoted 1 line
Quoted 1 line
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.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Anyone know how can I reduce the kernel cached
memory on RHEL >>3
Quoted 4 lines
(kernel
Quoted 1 line
Quoted 1 line
2.4.21-32.ELsmp - Trial version)? There is a way
to reduce the >>kernel cached memory utilization?
Quoted 5 lines
Quoted 5 lines
Probably RedHat's support can answer this for RHEL
3.
Quoted 2 lines
Quoted 2 lines
Bernd --
Firmix Software GmbH
http://www.firmix.at/ mobil: +43 664 4416156
fax: +43 1 7890849-55 Embedded Linux
Development and Services
Quoted 4 lines
Bernd,
The server runs RHEL Trial Version, without
support... for tests purpose.
Quoted 1 line
When I compile and run the following tester
program:
Quoted 1 line
#include <
stdio.h> #include <string.h> #include
<stdlib.h>
Quoted 2 lines
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); } }
Quoted 1 line
The server alocates lots of free memory (including
swap) to the tester program and when its finish, lots of cached memory are freed.
Quoted 1 line
Have someone an idea why it's happens? Or how can
I force the kernel to frees cached memory?
Quoted 3 lines
Thanks again (sorry my bad eglish again!)
Vinicius. Protolink Consultoria.
i may not be a kernel expert...(i read this list to learn and hopefully one day help ;) but i think that your problem is not the kernel but the program... this is the first lesson that you learn in C/C++ whatever you open you have to close it...(brackets, parenthesis, files,etc) and whatever you take you have to give it back(memory)...
you use maloc to take the memory but you don't free the memory at the end... i think that if you don't free the memory before you exit the program the system do not free the memory ever... :D try that and see if it works...
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com