Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have an idea for a project, a very cool project. Is there any way to obtain detailed memory access information for a given process or set of processes. I would need to encode the data for use in Machine Learning algorithms, particularly those pertaining to Artificial Neural Networks.
It depends on what you mean by "memory access information".
Basic paging statistics are available...
The usual problem with trying to use them is that the information is too coarse for any real use other than crudely optimizing the paging algorithm.
One example of a problem of insufficient data has to do with identifying if a page has been modified. To do it right requires hardware. HOWEVER, it can be done by software - by making all pages read only... if a write fault occurs, AND the OS has designated the page to be writable, then the page is made r/w, and the OS data marks it as "dirty"... then the interrupt is dismissed, and the instruction retried.
Slow... but workable. Use for statistics? really bad. frequently you would like to know "how often" is a page written to, how long between writes... to get that detailed amount of information really really needs hardware.
The next problem is that if you actually get enough information for good use, it comes way too fast (such as a program counter trace) for any use. Computing a modified paging algorithm takes longer than it takes the application being traced to run...
Most that I've met take a paging statistics snapshot once every 5-10 seconds, then spends a half second to compute updates...
Last edited by jpollard; 03-15-2013 at 01:14 PM.
Reason: small followup.
Valgrind is an instrumentation framework for building dynamic analysis tools.
Memcheck is one of the tools that comes with Valgrind:
When a program is run under Memcheck's supervision, all reads and writes of memory are checked, and calls to malloc/new/free/delete are intercepted.
Memcheck runs programs about 10--30x slower than normal.