Allocating large contigious memory in kernel

Feb 09, 2005 3 Replies

Is there a limitation in allocating large contigious memory in the Linux kernel?



VSS


Look at kmalloc.

There are a number of constraints on how much contiguous memory you can allocate. The exact constraint varies by system and by the type of memory you need. It also varies by the amount of fragmentation - as the system runs longer, the maximum contiguous region may be quite small.

If you really need a large contiguous region, I suggest - fixing your design so you don't need it physically contiguous or - using the bigphysarea patch (available for 2.4 and 2.6 kernels) The latter is not likely to get adopted into the mainline kernel but has been maintained by people for a few years now.

--Mark

As mark suggested try using the bigphysarea patch or try allocating memory at boot the memory u allocate here has to be managed by you and the OS doesnt see it all. The disadvantage in this approach is your code cannot be a module it has to built in into the kernel

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required