Re: not seeing dynamic library page-ins
Re: not seeing dynamic library page-ins
- Subject: Re: not seeing dynamic library page-ins
- From: Michael Smith <email@hidden>
- Date: Sun, 1 Nov 2009 12:16:44 -0800
I'm tracking page-ins in dynamic libraries used by Firefox.
I'm on Snow Leopard and using these DTrace probes:
vminfo::vnode_pagein:pgpgin { printf("page-in\n"); }
fbt::vnode_pagein:entry { self->v_name = stringof(((vnode_t)arg0)->v_name); printf("vnode name: %s\n", self->v_name); }
I see the library being opened by the dynamic linker and Firefox comes up just fine. Trouble is, I don't see any page-ins.
I thought this may be due to the Unified Buffer Cache but disabling the cache on a given library while keeping the while open has no effect.
Libraries are mapped; you can't disable caching for mapped data since the VM and the buffer cache are the same thing.
Where do the code pages come from and what am I missing?
The pages you're interested in are probably already resident.
You have something of a problem here; you want to simulate a launch of Firefox while the Firefox libraries are "cold" but the rest of the system is "hot".
Simulating a fully cold launch isn't hard; write a tool that allocates more virtual memory than you have RAM (at least 2x) and read from each page. This will tend to evict just about every page in the system that isn't being used to run your code. Then free the memory and immediately exec your application. Avoid writing anything to stdout (this will reheat paths in Terminal, CoreGraphics, etc.) or using LaunchServices (will reheat lots of things) to start the app. Likewise avoid having any other apps running, most especially anything that is displaying anything on the UI. Turn off the menubar clock, etc. etc.
Evicting things selectively is harder. You might try writing a tool that installs the libraries by copying them and setting F_NOCACHE on the copy destination descriptors. You should turn Spotlight off before you do this, or it will probably cause your copied files to be cached as it sniffs at them.
If you're trying to catch things that are in the shared (system) cache, your only hope is to reboot.
HTH.
= Mike
-- The lyf so short, the craft so long to lerne -- Chaucer
|
_______________________________________________
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