Virtual Memory
0.9
Matt McMinn
melfinadev@earthlink.net
http://home.earthlink.net/~melfina/
It's just a copy of the virtual memory preferences app that comes with BeOS.
1
Matthieu Ferte
mferte@club-internet.fr
Get the physical memory in a better way.
#include
int physMem;
system_info info;
get_system_info(&info);
physMem = (info.max_pages * 4096) / 1048576;
2
Matthieu Ferte
mferte@club-internet.fr
Get the current memory by reading the file.
#include
int currSwap;
const char *swap_file;
swap_file = "/boot/var/swap";
BEntry swap(swap_file);
off_t swapsize;
swap.GetSize(&swapsize);
currSwap = swapsize / 1048576;
3
Matthieu Ferte
mferte@club-internet.fr
Equation that calculates the minimum swap size is wrong (not linear).
I got the values on my computer with the original vm app :
Ram 256 Mb -> Swap 341 Mb
Ram 512 Mb -> Swap 640 Mb
Ram 768 Mb -> Swap 886 Mb
Ram 1024 Mb -> Swap 1133 Mb
With obos app i got :
Ram 256 Mb -> Swap 341 Mb
Ram 512 Mb -> Swap 683 Mb
Ram 768 Mb -> Swap 1024 Mb
Ram 1024 Mb -> Swap 1365 Mb
10/31/2001
Initial release. Visually complete.
Even tho it wasn't really necessary, I know I've overdocumented this app.
My excuse is that I wanted to learn how to use doxygen, and this was a
good app to run it on. So if you want full documentation, and you have
doxygen installed, available from BeBits, run doxygen .doxygen-conf
in the code directory, and it will create docs for you.