> Nick, I should have asked you those values when the system is under
> your hammer test. IIRC, Commited_As shows how much memory requested by
> processes and approved by kernel (it is not necessarily those memory
> are
> *really* in use now), and CommitLimit shows the maximum memory the
> kernel can accept for requests for normal pages ( not huge pages).
> Because you set aside 6G in huge pages and CommitedAs is about 6G
think
> your system not under stress tests now.
>
>
> To test the swap, I wrote a small program to allocate memory, but not
> use that memory at all at first. The amount of memory allocation is
> selected so that Commited_As gets very close to CommitLimit. When the
> program starts writing to the allocated memory then the swap activity
> starts quickly.
>
> It is very short program and its only parameter is the number of MiB
> the
> program asks for. You can try it. At every step of the program, see
> output of top and grep -i commit /proc/meminfo.
>
>
>
> #include <stdio.h>
> #include <stdlib.h>
> main(int argc, char ** argv) {
> char *p;
> long MiB=1024*1024l;
> long multiply = 1;
> long i;
> if( argc != 1 ) {
> multiply = atol(argv[1]);
> }
> p = (char *)malloc(multiply*MiB*sizeof(char));
> if( p== NULL ) {
> printf("failed at size=%ld MiB\n",multiply);
> exit(-1);
> } else {
> printf("passed at size=%ld MiB\n",multiply);
> printf("press Enter to start writing memory\n");
> getchar();
> for( i = 0; i < multiply*MiB; i++ )
> *(p+i)=1;
> printf("press Enter to exit");
> getchar();
> free(p);
> }
>
> }
>
>
> Vu
Hi Vu
thanks for the c prog, with that I proved that swap does work.
With the system under stress here are the settings you asked for:
[r...@psl-cu ~]# sysctl -q vm.overcommit_memory
vm.overcommit_memory = 0
[r...@psl-cu ~]# sysctl -q vm.overcommit_ratio
vm.overcommit_ratio = 50
What I have noticed is when I stress the system (whilst using hugepages
and memlock ulimit) the system will never swap, I have tried with
different valued for hugepages and memlock with no luck. The only way to
get the system to swap is to:
a. turn off hugepages and memlock
b. leave hugepages on but turn off memlock, however the system soon
freezes after doing this.
Many thanks,
Nick.
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4160 (20090616) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list