Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options -o and -r to save/read a list of files to use #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EtienneBruines
Copy link
Contributor

@EtienneBruines EtienneBruines commented Nov 3, 2016

Not sure if you want this, but since I wanted it, I thought I'd share it. (If you don't want to merge, I completely understand; I'll personally be using my fork in that case)

Use case:

You want to preload a certain program, let's say the Intellij IDEA located in /opt/idea. Let's say this is a huge directory, and you only want to preload the part of the program which it requires to start the program. To reduce the time needed to start it.

First you make sure none of it is in memory. Then you start the Intellij IDEA. Now you run vmtouch -o /opt/idea > ~/idea_preload.txt.

Now if you were to preload it (perhaps on boot), then you could simply do vmtouch -l -r ~/idea_preload.txt /opt/idea and you're good to go.

Caveats:

Using -r is slower than not using -r, because we're linearly going through every single entry in the list. Some kind of parsing-tree might be faster, but doing that in C sounds like a nightmare.

I'm also using filenames instead of resident_pages; so it'll preload more than it should, but less than it otherwise would if you loaded the entire directory.


Anyway, it's here if you want it.

@hoytech
Copy link
Owner

hoytech commented Nov 3, 2016

Thanks! Yes, this has been something we've been thinking about for a while...

I'm not opposed to adding similar functionality to vmtouch, but vmprobe is much more advanced than vmtouch in this department:

  • It works on the page level, not the file level, so exactly the portions of files that were in memory can be reloaded
  • The snapshots themselves are stored in a highly compressed format
  • On linux, you can record snapshots about not only the pages that are resident in memory, but also other page flags, such as which LRU list they are on, whether they have been referenced since the last requeue, etc
  • Snapshots can be manipulated with algebraic expressions, in case you want to load (for example) all the pages that weren't resident yesterday but were resident a week ago, without affecting any other pages

@hoytech
Copy link
Owner

hoytech commented Jan 16, 2017

We landed a similar patch here: #49

Of course I'll be mentioning you in the changes file for design help.

We still need to get to your "-o" functionality, but we're half way there I suppose. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants