• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ascertaining dirty pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ascertaining dirty pages


  • Subject: Re: Ascertaining dirty pages
  • From: Vincent Coetzee <email@hidden>
  • Date: Mon, 18 Feb 2008 17:39:28 +0200

Hi Steven,

I am aware of vmmap, but perhaps I did not make the nature of my problem very clear. My application needs to know about these pages, and needs to be able to access information about the pages. Additionally vmmap does not tell one which pages are dirty, ,it just tells you about virtual memory allocated to a process. I need to know on a page by page basis (i.e. currently 4096 bytes per page) which pages have been written to and the exact address of the changes within the page.

Thanks anyway

Vincent

On 18 Feb 2008, at 3:38 PM, Steven Bytnar wrote:

man vmmap

vmmap has been around since at least 10.2.

Here's an example of the output:
% vmmap -pages screen
Virtual Memory Map of process 5755 (screen)
Output report format:  2.2  -- 32-bit process

==== Non-writable regions for process 5755
__PAGEZERO 00000000-00001000 [ 1] ---/--- SM=NUL .../bin/screen
__TEXT 00001000-00046000 [ 69] r-x/rwx SM=COW .../bin/screen
__LINKEDIT 0004e000-00051000 [ 3] r--/rwx SM=COW .../bin/screen
STACK GUARD 00051000-00052000 [ 1] ---/rwx SM=NUL
STACK GUARD 00053000-00054000 [ 1] ---/rwx SM=NUL
STACK GUARD 00068000-00069000 [ 1] ---/rwx SM=NUL
STACK GUARD 0006a000-0006b000 [ 1] ---/rwx SM=NUL
__TEXT 8fe00000-8fe31000 [ 49] r-x/rwx SM=COW / usr/lib/dyld
__LINKEDIT 8fe68000-8fe76000 [ 14] r--/rwx SM=COW / usr/lib/dyld
__TEXT 91a5c000-91bf6000 [ 410] r-x/r-x SM=COW ...tem.B.dylib
__TEXT 93735000-93767000 [ 50] r-x/r-x SM=COW ...s.5.4.dylib
__TEXT 93ff4000-94000000 [ 12] r-x/r-x SM=COW ...c_s.1.dylib
__TEXT 9611c000-96122000 [ 6] r-x/r-x SM=COW ...mon.A.dylib
__LINKEDIT 96e6e000-972da000 [ 1132] r--/r-- SM=COW ...mon.A.dylib
STACK GUARD bc000000-bf800000 [ 14336] ---/rwx SM=NUL
STACK GUARD fffec000-ffff0000 [ 4] ---/rwx SM=NUL
shared memory ffff8000-ffffa000 [ 2] r-x/r-x SM=SHM


==== Writable regions for process 5755
__DATA 00046000-0004e000 [ 8] rw-/rwx SM=COW .../bin/screen
MALLOC (freed?) 00052000-00053000 [ 1] rw-/rwx SM=PRV
MALLOC_LARGE 00054000-00068000 [ 20] rw-/rwx SM=COW ...ne_0x100000
MALLOC (freed?) 00069000-0006a000 [ 1] rw-/rwx SM=COW
MALLOC_TINY 00100000-00200000 [ 256] rw-/rwx SM=PRV ...ne_0x100000
MALLOC_TINY 00200000-00300000 [ 256] rw-/rwx SM=COW zone_0x0
MALLOC_SMALL 00800000-01000000 [ 2048] rw-/rwx SM=PRV ...ne_0x100000
__DATA 8fe31000-8fe68000 [ 55] rw-/rwx SM=COW / usr/lib/dyld
__DATA a0336000-a0377000 [ 65] rw-/rwx SM=COW ...tem.B.dylib
__DATA a0767000-a0770000 [ 9] rw-/rwx SM=COW ...s.5.4.dylib
__DATA a0890000-a0891000 [ 1] rw-/rwx SM=COW ...c_s.1.dylib
__DATA a0c02000-a0c03000 [ 1] rw-/rwx SM=COW ...mon.A.dylib
Stack bf800000-c0000000 [ 2048] rw-/rwx SM=COW thread 0


==== Legend
SM=sharing mode:
	COW=copy_on_write PRV=private NUL=empty ALI=aliased
	SHM=shared ZER=zero_filled S/A=shared_alias

==== Summary for process 5755
ReadOnly portion of Libraries: Total=6980K resident=6700K(96%) swapped_out_or_unallocated=280K(4%)
Writable regions: Total=18.3M written=224K(1%) resident=356K(2%) swapped_out=0K(0%) unallocated=18.0M(98%)


REGION TYPE             [ VIRTUAL]
===========             [ =======]
MALLOC                  [    2582]
STACK GUARD             [   14344]
Stack                   [    2048]
__DATA                  [     139]
__LINKEDIT              [    1149]
__PAGEZERO              [       1]
__TEXT                  [     596]
shared memory           [       2]

--Steve


On Mon, Feb 18, 2008 at 01:43:00PM +0200, Vincent Coetzee wrote:
Dear List,

I am hoping someone on these lists can assist me with my little
problem. If the problem is not appropriate to these lists, could
someone please point me in the right direction. I have a requirement
to know which memory pages (allocated by my application) have been
written to during the execution of my application, I also need to know
the addresses of the areas of the pages that have been changed. I have
spent hours perusing the BSD and Darwin documents without finding
anything that seems to allow for this. Does anyone know how to do this
or can suggest something please, I am at my wits end.


Thanks in advance

Vince
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Ascertaining dirty pages (From: Vincent Coetzee <email@hidden>)
 >Re: Ascertaining dirty pages (From: Steven Bytnar <email@hidden>)

  • Prev by Date: Re: Ascertaining dirty pages
  • Next by Date: Re: shm_open and EMFILE
  • Previous by thread: Re: Ascertaining dirty pages
  • Next by thread: USB device prevented from mounting
  • Index(es):
    • Date
    • Thread