On Thu, 2010-06-03 at 11:36 -0700, Ketan wrote:
> Thanx Rick .. but this guide does not offer any method to reduce the ARC
> cache size on the fly without rebooting the system. And the system's memory
> utilization is running very high since 2 weeks now and just 5G of memory is
> free. And the arc cache is showing 40G of usage. and its not decreasing its
> just increasing.
Write a program which does a bunch of mallocs. This should cause zfs to
release data. Then when your program exits, you'll be able to use the
memory it left behind.
For example:
/* usage: a.out <size> <repeat> */
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
int sz, cnt, fail, i;
if (argc < 2) {
printf("usage: %s <size> <count>\n", argv[0]);
exit(1);
}
sz = atoi(argv[1]);
cnt = atoi(argv[2]);
fail = 0;
printf("Performing %d allocations of %d bytes\n", cnt, sz);
for (i = 0; i < cnt; i++) {
if (malloc(sz) == NULL) {
fail++;
}
}
printf("Mallocs: %d succceeded, %d failed\n",
cnt - fail, fail);
exit(fail);
}
-- Garrett
_______________________________________________
zfs-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss