On Sun, Apr 16, 2000 at 03:36:31PM +0200, Poul-Henning Kamp wrote:
> In message <[EMAIL PROTECTED]>, Anatoly Vorobey writes
> :
> >I have to malloc a lot of memory in the kernel, hence a few
> >questions:
> 
> How much is "a lot" ?

Apparently somewhere in the vicinity of 8Mb, and also coming in a form
of many hash tables, dynamic-size linked lists, variable-length
structs, etc. so it's not practical to estimate a high bound, allocate
and be done with it.

FWIW, I think Win32 got it right in providing growable private heaps,
where you can create your own heap and malloc() from it, and then just
return all the memory back with one destroy call. It makes a lot of sense
in some contexts.

> >1. The data must be absolutely present at all times, no page
> >faults or locking mechanisms, etc. Does that mean
> >I should use kmem_alloc_wired() or am I misunderstanding its purpose?
> >Does it make sense to alloc less than a pageful or is the rest simply
> >going to be wasted?
> 
> malloc(9) should be used.

Thanks!

-- 
Anatoly Vorobey,
[EMAIL PROTECTED] http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to