Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Dec 97 10:17:02 -0500
From:      "Richard Seaman, Jr." <lists@tar.com>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Virtual Memory Question
Message-ID:  <199712121617.KAA06873@ns.tar.com>

next in thread | raw e-mail | index | archive | help
If I allocate memory using either malloc or mmap, how do I know if the
address handle I get back can be mapped to physical backing of some
sort (RAM or swap)?

For example, I have a machine with 16MB RAM and 64MB swap.  Using
malloc, I can malloc just about 128MB.  Obviously, thats more than I
can get physical backing for.  Trying to access it all terminates
the process, as would be expected.

For mmap (MAP_ANON with fd -1), I can "allocate" virtual memory totalling
over 3GB.  Same problem.

Or, am I just supposed to be smart enough to not grab too much memory?

Thanks.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712121617.KAA06873>