Messages in this thread | ![/](/images/icornerl.gif) | | Date | Tue, 11 Mar 2003 11:13:42 -0800 (PST) | From | Jason Li <> | Subject | out_of_memory called to often |
| |
Hi,
We are running an embedded linux (2.4.19) with no swap sapce. And we haven't applied any rmap yet.
Currely when the system runs low (reached the pages_low water-mark), kswapd kicks in. But soon after kswapd kicks in, the out_of_memory is called due to swapd not being able to reclaim enough pages from the page cache from each run of it. I don't understand why sometimes swapd can't reclaim the SWAP_CLUSTER_MAX number of pages.
We know there are still some number of cache pages that can be reclaimed if we run the following c program:
int main() { int i, j; char *tmp[10000]
for (i=0; i<NUMBER_OF_PAGES_LEFT_BEFORE_pages_low; i++) tmp[i]=malloc(4k); for (i=0; i<NUMBER_OF_PAGES_LEFT_BEFORE_pages_low; i++) free(tmp[i]); } To solve this problem, I am trying to make a conditional call to the out_of_memory() -- only if the pages_min is reached, then the out_of_memory() can be called.
If we can solve the swapd livelock problem, is this a feasible solution? If you have a better idea, can you please share with us?
Any input will be greatly appreciated.
Thanks very much in advance! Please include my email address in your reply.
-Jason
__________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |