How to record access to virtual page of process in linux? - memory-management

I want to track the access count of pages by a application with swap enable.
Does modify mark_page_accessed to implement it is possible?
Or other solution which is more elegant and convenient?
If it can be done in user space that would be better, plz give me some tips.
Thanks!
I have googled but could not find a specific solution.
It would be great if you can give some tips.

A smapling way works by clearing the pte bits constantly and Working Set Size (WSS) Tools (https://github.com/brendangregg/wss) is a good choice.

Related

How to collect all alterationof /proc/pid/pagemap in Linux

I want to know all the virtual to physical address map information for a specific progress for all its life. So one way is to get all the alteration of the pagemap which is changing all the time.
One way come to me is to read the pagemap using loop to detect whether current pagemap is exactly the same as the former. If this realizable? or any other suggestions is appreciated. Thanks
Adam

windows memory managment: check if a page is in memory

Is there a way, in Windows, to check if a page in in memory or in disk(swap space)?
The reason I want know this is to avoid causing page fault if the page is in disk, by not accessing that page.
There is no documented way that I am aware of for accomplishing this in user mode.
That said, it is possible to determine this in kernel mode, but this would involve inspecting the Page Table Entries, which belong to the Memory Manager - not something that you really wouldn't want to do in any sort of production code.
What is the real problem you're trying to solve?
The whole point of Virtual Memory is to abstract this sort of thing away. If you are storing your own data and in user-land, put it in a data-structure that supports caching and don't think about pages.
If you are writing code in kernel-space, I know in linux you need to convert a memory address from a user-land to a kernal-space one, then there are API calls in the VMM to get at the page_table_entry, and subsequently the page struct from the address. Once that is done, you use logical operators to check for flags, one of which is "swapped". If you are trying to make something fast though, traversing and messing with memory at the page level might not be the most efficient (or safest) thing to do.
More information is needed in order to provide a more complete answer.

Android How to use multiple pointers for dual joysticks

The app contains 2 virtual joysticks and I'm having trouble figuring out how to move them independently at the same time without the pointers getting mixed up.
Would someone be kind enough to give me some general advice?
I'd post what I have except it's so messy at this point I don't even know how it works. I'm just going to scrap it and start over.
You might want to take a look at the open source widgets of mobile-anarchy: https://code.google.com/p/mobile-anarchy-widgets/wiki/JoystickView
It provides code and samples for both single and dual virtual joysticks. Probably you can get some help by looking at their code, or maybe use those joysticks in your own application.

Find monitor size and it's company

How can i find the monitor size(not pixel, actual physical size) and it's company(manufacturer) by using vb6 code. I saw some links which give screen size using WMI(WmiMonitorBasicDisplayParams and WmiMonitorID) and some other by using some registry, but nothing worked for me. Can anyone tell me how it can be done by using vb6.
There is a good article about it : here
He describes the same steps as you tried, which failed, and came up with something else in the end.
I don't know if it works for you, but it seems the most promising I could find.

Increasing productivity | What commands am I repeating?

I'm looking for a programming that monitors my activity in Windows Vista/XP/2003 that lets me know what commands, shortcuts, web sites, etc. I visit more frequently.
with this information I could create shortcuts, hotkeys, aliases, etc to increase productivity, as time goes on I could know how much time I saved in comparison to other days.
Leon Bambrick's time snapper is pretty interesting. May not be exactly what your looking for though. http://www.timesnapper.com/
There's a program called Rescue Time which monitors your applications and website usage.
Slife
I have a program like that and have used it for years. It's called laziness. When I get tired enough of doing the same thing over again, I write a program or script to do it for me.
Not exactly a tool to record your activity, but Tasktop might help you achieve what you want.
I use Mylyn, Tasktop little bother, in eclipse to organize and keep me focused in my tasks, and it's a great help.

Resources