Obtaining a buffer of real (non-swap/virtual) memory

Obtaining a buffer of real (non-swap/virtual) memory

Post by Mack Stevens » Sat, 26 Jan 2002 01:35:59



Howdy,

I wonder if in Linux it is possible when allocating memory to ask the
system for it to be only real memory, not virtual memory. For security
reasons it might prove useful to make sure that certain data won't be
written to disk, even if it is only on the swap partition.

Later,

Mack

 
 
 

Obtaining a buffer of real (non-swap/virtual) memory

Post by Kasper Dupon » Sat, 26 Jan 2002 01:54:01



> Howdy,

> I wonder if in Linux it is possible when allocating memory to ask the
> system for it to be only real memory, not virtual memory. For security
> reasons it might prove useful to make sure that certain data won't be
> written to disk, even if it is only on the swap partition.

Yes, you can use mlock() or mlockall(). Unfortunately I think those
calls still requires root permitions when used on Linux.

--
Kasper Dupont


 
 
 

Obtaining a buffer of real (non-swap/virtual) memory

Post by Michael Shigori » Sat, 26 Jan 2002 03:05:43


MS> system for it to be only real memory, not virtual memory. For security
MS> reasons it might prove useful to make sure that certain data won't be
MS> written to disk, even if it is only on the swap partition.
Lock them (like gnupg and friends working with sensitive information).

man -k lock
/mem

--

  ------ http://visa.chem.univ.kiev.ua/~mike/

 
 
 

1. Real Memmory /Virtual Memory /Physical Memory Accountancy.

Dear Forum!
Any kind person to respond?

I used this program:

#include <stdio.h>
#include <sys/pstat.h>
main()
{
struct pst_static buf;
struct pst_dynamic dyn;
pstat_getstatic(&buf,sizeof(struct pst_static),1,0);
pstat_getdynamic(&dyn,sizeof(struct pst_dynamic),1,0);
printf("Total  Page Size=%dB\n",buf.page_size);
printf("Total  Phys memory=%dMB\n",buf.page_size/1024*buf.physical_memory/1024);
printf("Total  Virt memory=%dMB\n",buf.page_size/1024*dyn.psd_vm/1024);
printf("Active Virt memory=%dMB\n",buf.page_size/1024*dyn.psd_avm/1024);
printf("Total  Real memory=%dMB\n",buf.page_size/1024*dyn.psd_rm/1024);
printf("Active Real memory=%dMB\n",buf.page_size/1024*dyn.psd_arm/1024);
printf("Free        memory=%dMB\n",buf.page_size/1024*dyn.psd_free/1024);

Output is:

Page Size=4096B
Total  Phys memory=2047MB
Total  Virt memory=597MB
Active Virt memory=333MB
Total  Real memory=665MB
Active Real memory=352MB
Free        memory=263MB

I use HP-UX Release 11.0.

What is it's interpretation? How can I obtain 2047 MB using other
parameters?
Like Total Phys Memory = Total Real Memory + Total Free Memory or
something like that....
Virtual Memory - Does it have any share in RAM? I knew that it is the
disk space
getting used.
If real memory is 665MB Far less compared to Total Phys Memory then
why
there is some figure in the account head of Active Virual Memory? I am
confused...

I did man vmstat ..It did not said avm - actual virtual pages ..show
shall
I multiply the shown figure with Page Size=4096B? No where unit is
mentioned
in HP-UX 11.0 documentation.

Waiting eagerly for your reply.

Cheers!
Samik Nath

2. exactly what is the syntax for mknod?

3. Is swap space in SCO only swap space or is it consider virtual memory

4. Children's exit code [ksh]

5. Why using swap space instead of real memory?

6. Motif 1.2

7. Problem with Real memory and swap file

8. System-fault with lib5.4.44

9. swap space and real memory

10. free, buffer and swap memories usage

11. How to fix a buffer in main memory, without going to swap.

12. command to check the real memory and swap space?

13. memory uage - real, virtual & caching