Memory mapped pages not being swapped out

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there, I am running a program where I need to map hundreds of thousands of files and each file has several kilobytes (min. of 4kb per file). The program calls mmap() for every 4096 bytes on each file, ending up with millions of memory mapped pages, so I have ceil(N/4096) pages for each file, where N is the file size.

As the program runs, more files are created and the older files get bigger, then I need to remap those pages, so it's always adding more pages.

I am concerned about when and how Linux is going to swap out pages in order to get more memory, the program seems to only increase memory usage overall and I am afraid it runs out of memory.

I tried setting these sysctl parameters so it would swap out as soon as possible (just to understand how Linux memory management works), but it didn't change anything:

vm.zone_reclaim_mode = 1
vm.min_unmapped_ratio = 99


How can I be sure the program won't run out of memory? Do I have to manually unmap pages to free memory?

Thanks so much

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux